0

Final edit: I played with a few different files got some more errors and then reinstalled rvm and everything else from the start, found a few fixes and edited them and finally everything works. thank you everyone for your help

Edit: I have noticed that it says Library not loaded: /usr/local/mysql-5.5.10-osx10.6-x86_64/lib/libmysqlclient.18.dylib (LoadError)

But I have mysql 5.5.11, how do I fix that?

I literally have searched for the past 3 hours, but found nothing that worked

Same error occurs when I either try to launch the server or generate a model

I have bundler and mysql2 gems.

builder (2.1.2) bundler (1.0.12) erubis (2.6.6) i18n (0.5.0) mail (2.2.17) mime-types (1.16) mysql2 (0.2.7)

I get the following output:

    hrs772:demo kishinmanglani$ rails s
/Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `require': dlopen(/Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/mysql-5.5.10-osx10.6-x86_64/lib/libmysqlclient.18.dylib (LoadError)
  Referenced from: /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `<top (required)>'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'
    from /Users/kishinmanglani/rails_projects/demo/config/application.rb:7:in `<top (required)>'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
    from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
2
  • Taking a wild stab here..have you tried using another mysql gem? The ones I know of are mysql, 'mysql2, and mysql-ruby. Commented Apr 21, 2011 at 5:06
  • I have not, but I would rather have the issue resolved with the mysql2 gem instead of just switch to the mysql or mysql-ruby gems Commented Apr 21, 2011 at 5:23

2 Answers 2

1

Whenever you get load errors you should make sure you have all of the dependencies installed and in place.

  1. Make sure you have gem mysql2 in your Gemfile.
  2. Install bundler if you don't already have it with gem install bundler.
  3. Run bundle (same as bundle install).

Then try running the server again.

Sign up to request clarification or add additional context in comments.

Comments

0

mysql2 with rails 3.0.3 is give some error so try to update rails version with 3.0.6

it working fine so try

4 Comments

I am actually using rails 3.0.7
rails 3.0.7 is not stable now it also give me error with jruby so try with rails 3.0.6 its more stable its working realy good
now i get the error Could not find rails-3.0.7 in any of the sources after installing 3.0.6 and uninstalling 3.0.7
change in gemfile gem"rails 3.0.6" and check with rails -v

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.