ProBLOG™

Ruby On Rails

The blog posts listed below are related to Ruby On Rails.

The bundled mysql.rb driver has been removed from Rails 2.2 in Aptana

I use Aptana Studio to program in Ruby on Rails.  Today, I upgraded Rails to 2.2.2 on my laptop and after I did that, Aptana complained that MySQL's driver had been removed.  The error happened after I loaded Mongrel inside Aptana and I tried to view the application's homepage.

This is the error that I'd get:

"!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql."

After reinstalling everything a few times, I found a forum post that put me on the right direction.

When I upgraded, it installed a newer version of the MySQL gem, which apparently doesn't work well with Aptana.  To fix, I put the old MySQL dll in my ruby\bin folder, and it worked like a champ.

The dll file is here:

http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll

I'm using the InstantRails package, and so my ruby folder is here: c:\rails\ruby\bin

I then restarted the MySQL server and Aptana and it worked perfectly.

Upgrading to Rails 2.2.2 in Instant Rails with Rmagick

This article assumes assuming that you're using the Rmagick gem. If not, just skip the Rmagick instructions. It also assumes that you're comfortable getting around in a Windows command prompt and installing and uninstalling standard Windows programs.

Upgrading Ruby on Rails is fairly easy, though there are a few steps involved.

First you'll need to download the latest Rmagick gem with ImageMagick. At the time of this writing, it is 2.7.1 for Ruby 1.8.6.

Unzip it to somewhere easy to get to at a command prompt then type the following commands:

gem uninstall rmagick
gem uninstall sqllite3-ruby
gem update --system
gem update
gem cleanup

Uninstall any existing version of ImageMagick that you have and then install the version of ImageMagick that came in your Rmagick gem zip.

Navigate to where you unzipped the Rmagick gem in the command prompt and type:
gem install --local rmagick

Next, make sure you have all the gems required by your application such as will_paginate by navigating to your application root, and running:
rake gems:install

Of course, the gems need to be defined in the config/environment.rb file. In my case, I have mislav-will_paginate defined like this:

Rails::Initializer.run do |config|
  #Get the Will_Paginate Plugin
  config.gem 'mislav-will_paginate',
    :version => '~> 2.3.6',
    :lib => 'will_paginate',
    :source => 'http://gems.github.com'
    #...
end

That should be it. I usually run 'rake log:clear' just to clear out those text files since they get pretty fat. For tips like these and other useful technical tips, visit Ask Some Geeks.


Displaying all 2 Blog Posts

 

Register a ProSPOTLIGHT Account     Explore Benefits of ProSPOTLIGHT Membership

Explore ProSPOTLIGHT Features