Isnor Creative
Isnor Creative Blog
Ruby, Ruby on Rails, Ember, Elm, Phoenix, Elixir, React, Vue

Jun 28, 2010

Ruby on Rails 3, MySQL gem problems with Mac OS X Snow Leopard

I’ve been trying to get into Ruby on Rails 3 but have been running into lots of problems that keep sending me back to Rails 2.x with my tail between my legs.

The latest problem is when I create a new Rails 3 beta 4 app with MySQL as the default database. I run bundle install and everything looks good, but when I start the app I get the following error:

undefined methodinit’ for Mysql:Class`

The backtrace ends here:

activerecord (3.0.0.beta4) lib/active_record/connection_adapters/mysql_adapter.rb:30:inmysql_connection’`

My system set up is:

  • Ruby: ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
  • Rails: Version 3 Beta 4
  • Mac: Snow Leopard 10.6.4
  • MySQL gem version 1.3.6

I ended up getting the app working by changing from the mysql gem to the ruby-mysql gem.

In Gemfile:

gem 'ruby-mysql'


I am available for Ruby on Rails consulting work – get in touch to learn more.

Gordon B. Isnor

Gordon B. Isnor writes about Ruby on Rails, Ember.js, Elm, Elixir, Phoenix, React, Vue and the web.
If you enjoyed this article, you may be interested in the occasional newsletter.

I am now available for project work. I have availability to build greenfield sites and applications, to maintain and update/upgrade existing applications, team augmentation. I offer website/web application assessment packages that can help with SEO/security/performance/accessibility and best practices. Let’s talk

comments powered by Disqus