简体   繁体   中英

MySQL bindings for Rails 2.3.5 on Mac OS X 10.5.8

I have a rails environment which I set-up with macports. I recently updated macports which seems to have had the side effect of breaking rails. When I try to boot a rails server I get:

$ ./script/server => Booting WEBrick => Rails 2.3.5 application starting on http://0.0.0.0:3000 /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. /opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin9/mysql.bundle: dlopen(/opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin9/mysql.bundle, 9): Library not loaded: /opt/local/lib/mysql5/mysql/libmysqlclient.15.dylib (LoadError) Referenced from: /opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin9/mysql.bundle Reason: image not found - /opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin9/mysql.bundle

I've tried reinstalling the mysql gem many times using various configurations I've found around the web but nothing seems to help. Also, when I try to use rake I get:

rake db:migrate Rails requires RubyGems >= 1.3.1 (you have 1.0.1). Please rake db:migrate Rails requires RubyGems >= 1.3.1 (you have 1.0.1). Please gem update --system and try again.

Even though:

gem --version 1.3.6

What's going on here?

It seems the problem was that I had rails installed under macports, and also as a gem. I uninstalled all the rails components from macports and just stuck with the gems version and it seems to have made the MySQL problem go away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM