Mysql::Error: query: not connected with Rails ActiveRecord

If you run rake db:migrate and experience that error:

rake aborted!
Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:202:in `rescue in log'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:194:in `log'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb:289:in `execute'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:167:in `create_table'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb:445:in `create_table'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:430:in `initialize_schema_migrations_table'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/migration.rb:487:in `initialize'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/migration.rb:433:in `new'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/migration.rb:433:in `up'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/migration.rb:415:in `migrate'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0/lib/active_record/railties/databases.rake:142:in `block (2 levels) in '
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run'
C:/Ruby192/bin/rake:31:in `'

then try to do this to solve the problem:

  1. download an older libmysql library dll, e.g. from here
  2. put it in your rails installation directory, e.g. C:/Ruby192/bin/
  3. restart the rails server

Top WordPress Plugins you probably have to use

Resource booking

This WordPress plugin will enable online booking services for your site. Visitors to your site will be able to book or to check availability of apartments, houses, hotel rooms, or services you offer. They can also make reservations and appointments with the ability to choose from multi-day, single day, or by the hour booking. Your clients can even view and register for upcoming events. With integrated Paypal/Sage payment support your clients can pay online!

kPicasa Gallery

This plugin displays your Picasa Web Galleries in a post or in a page simply by creating a post or a page with a special keyword. All the images are kept on the Picasa Web Gallery server.

qTranslate

Writing multilingual content is already hard enough, why make using a plugin even more complicated? I created qTranslate to let WordPress have an easy to use interface for managing a fully multilingual web site. qTranslate makes creation of multilingual content as easy as working with a single language.

Fluency Admin

Bored of your wp-admin panel crunchy look? Move to a better one by using fancy Fluency Admin! Check out the screenshots!

Google Maps support – mapress

The MapPress plugin makes it easy to add Google Maps and driving directions to your blog.  Just type some addresses in the post edit screen and click the ‘insert’ button.  The plugin will insert a great-looking map with markers and directions right into your post.

Ultimate Google Analytics

Plugin to add Google Analytics JavaScript to each page on your weblog without making any changes to your template. The plugin can also add tracking to outbound links, downloads from your own site and mailto: links.

The plugin is highly configurable. Read trough the list of features below to get a feeling of what this plugin can do. You can enable and disable all features individually, although the default configuration will suffice for 90% of the users.

wp-bannerize

WP Bannerize is an Amazing Banner Image Manager. One can use it by PHP function in a template or as a widget. Very powerful, very flexible, a must have for sites that do banners exchange!

WordPress Audio Player

Viper Quicktags – video embedding

Tired of copying and pasting the embed HTML from sites like YouTube? Then this plugin is for you.  Yes, WordPress 2.9 and WordPress 3.0 feature native easy embeds. However this plugin offers more customization than allowed without the plugin (player colors, etc.). It will work fine side by side with the new code and you can opt to use either embed method.

WP Syntax Highlighter

SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without having to escape the code or anything. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev to do the highlighting and supports all of the package’s parameters via shortcode attributes.

SEO: Google XML Sitemap Generator

Ubuntu 9.04 on Intel Itanium2 hangs after upgrade

This is a hint for all those who are happy users of IA-64 and Ubuntu 8.04 (hardy) and would like to upgrade to 9.04 (karmic).

The upgrade process is as simple as editing /etc/apt/sources.list,  changing hardy to karmic and doing apt-get dist-upgrade. After that however, you will experience a blank screen with flashing cursor after initrd is loaded. It seems that there is a problem with some changed features in the kernel.

As I didn’t have enough patience and time to recompile the kernel  milion times, I thought about a little trick. I have used the config of the working kernel from hardy as a base and built a new kernel for 9.04.

I have used the same approach to upgrade from 8.04 to 10.04. Firstly, from hardy to karmic, and then from karmic to lucid. And it works perfectly!

hints: using screen in linux

I am working a lot with screen, especially to get to remote hosts and do many operations at once.
The thing that was irritating me a lot, was the fact that I had to set the titles of windows manually after logging in via ssh.

Simple authentication in Zend Framework

This is quick example of how to do a very simple authentication in Zend Framework. It doesn’t user external database for getting the credentials, although you can make it very easily to read data in the Auth adapter from an external file or MySQL database.

Must-Have Software for a developer

I’m presenting some obviously FREE software that I am using and that can really help while doing development of desktop or normal application as well as while for network monitoring and other tasks.

Synchronizing Mailman lists with LDAP

Quite common usage scenario is a Postfix mail server with a Mailman instance for groups. Even more often the accounts for the mail are stored in an LDAP tree. And in this case a problem appears, because Mailman doesn’t have a native connection to LDAP. That’s why I needed to have an LDAP 2 Mailman script that would synchronise mailman groups with the LDAP tree. This Perl script is meant to be run from cron.

What this script does is the following:

Postfix Hints

Hints for Postfix 2.6 or higher that are commonly mentioned problems or scenarios.

Pairing Apple bluetooth devices with Windows XP

It seems that Microsoft Windows XP has a problem with pin-less Apple devices.

I hate cables and wires all around me, so I’ve decided to switch to a bluetooth mouse and keyboard.

The problem arose when I was trying to pair the devices with WinXP, because the pin-box was empty:

Getting inside via open door – hacking ldd

Peteris Krumins has recently written in his blog a very nice article on basic security of sysadmins. He exploits, or… maybe a better word here is… evaluates a door that is there in ldd for ages, but neverthelesss not many sysadmins are aware of it, while checking user programs with ldd from root account.

This bug-o-feature has been also recently noticed by Debian community, though it is still not present in many heads.

Very nice article to keep your head around hygiene of administering your *nix systems in a responsible way of ‘thinking before doing’.