Reputation: 19312
I'm trying to start my server for an existing rails project on my local machine and i'm getting the error below. Can anyone explain why i'm getting this error and how to fix it?
$ rails s
/Users/tomcaflisch/Sites/mysite/refinerycms/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require': cannot load such file -- mysql2/mysql2 (LoadError)
from /Users/tomcaflisch/Sites/mysite/refinerycms/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `<top (required)>'
from /Users/tomcaflisch/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
...
Here's some posssibly relevant output to help figure out the issue:
$ which ruby
/Users/tomcaflisch/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]
Upvotes: 0
Views: 3062
Reputation: 9693
It could be a different of things, but something secure is that your rails application cannot find the mysql gem.
The first advise would be to use ruby 1.9.3 instead of ruby 1.9.1
But the quickest solution should be to install all your gems again for the project.
So go to your website, and delete all the files under /Users/tomcaflisch/Sites/mysite/refinerycms/ruby/ (that will delete the bundle Gems), delete Gemfile.lock, and run: bundle install
That should fix the issue ;)
Before doing that, you can also try to just run bundle update and that may also fix the issue.
Upvotes: 1