代码之家  ›  专栏  ›  技术社区  ›  lach

Mac OS X 10.5.8上用于Rails 2.3.5的MySQL绑定

  •  0
  • lach  · 技术社区  · 14 年前

    我用macports设置了一个rails环境。我最近更新了macports,它似乎有打破铁轨的副作用。当我尝试启动rails服务器时,我得到:

    $ ./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

    我已经尝试过多次重新安装mysql gem,使用的是我在web上找到的各种配置,但似乎没有任何帮助。另外,当我尝试使用rake时,我得到:

    rake db:migrate Rails requires RubyGems >= 1.3.1 (you have 1.0.1). Please gem更新——系统 and try again.

    尽管:

    gem --version 1.3.6

    怎么回事?

    1 回复  |  直到 14 年前
        1
  •  1
  •   lach    14 年前

    问题似乎是,我在macports下安装了rails,而且它也是一个gem。我从macports中卸载了所有rails组件,并坚持使用gems版本,这似乎让mysql的问题消失了。