Thursday, July 30, 2009

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

I encountered this problem before but apparently forgot to write a blog on the topic. So... after having re-searched Google and re-lived the pain, here is the short story...

This message appears under the following situations: You don't have MySQL 5.0.77, you don't have Rails 2.2.2, and you did not build the Gem: mysql-2.7. There are a number of posts on this topic, most of which take you absolutely nowhere. Just do the following (in order, and assuming you are running Mac OS 10.5.x):

  1. Install MySQL 5.0.77. To check your current version, type: 'mysql --version'
  2. Switch to your administrator user account using: 'su - Admin' (or whatever the admin account name is)
  3. Verify that the following line exists in .bash_profile: 'export GEM_HOME="/usr/lib/ruby/gems/1.8"
  4. Verify that the following lines exist in .gemrc: 'gempath:' and ' - /usr/lib/ruby/gems/1.8'
  5. Type the following set of commands:

    • cd /usr/lib/ruby/gems
    • sudo chmod 777 1.8
    • cd 1.8
    • sudo chmod 777 gems
    • sudo chmod 777 cache
    • sudo chmod 777 specifications
    • sudo chmod 777 doc
    • cd ..
    • gem install -v=2.2.2 rails
    • gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config


    The chmods are there because in Mac OS, the "Admin" user is different from the "root" user. Because they might have different GEM_HOME environments, it is easier to just make sure the Admin user paths are set properly and execute gem installs as Admin. Trying to enforce gem install paths on the root user is bothersome, to say the least.

    If you don't upgrade Rails to 2.2.2, you get an error message when you try to use 'mongrel_rails start'.

    If you don't upgrade the mysql gem you get the error in the title of this blog entry

    Important note: At this time, 'mongrel_rails start' should work but if 'rake db:create' still shows the error, copy the mysql-2.7 gem directory to /Library/Ruby/Gems/1.8/gems/. This indicates that the Web server is pointing to a different gem directory and I haven't figure out yet how to change that.

Wednesday, July 8, 2009

Compiling ffmpeg and ffplay

Wow, this topic can go on and on... Let me see if I can distill it to the very essentials.

First, to code in C or C++ effectively, get Eclipse for C/C++ Developers. That said, you don't need Eclipse for the rest of this blog entry.

Download these three things: LAME, SDL, and FFmpeg. You may have trouble downloading LAME as the SourceForge server seems to be unreliable. Compile them in that exact order (this is very important). Use the instructions here as well as the instructions included in the downloads. I'm distilling days of effort into a single paragraph so I'll update this entry or add a new one if I try this again...

When you're done, a successful adventure will mean you can invoke the ffmpeg transcoder as well as the sample ffplay by entering them as a Unix command.