Rails on MaC语言 rake db:create error



我在MAC上安装了RVM和rails(Mavericks 10.9.1),我尝试运行rake db:create。但是我经常收到此错误:

 MacBook-Pro-Szymon:wybierzto Fengson$ rake db:create
    rake aborted!
    dlopen(/Users/Fengson/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle, 9): Library not loaded: /opt/local/lib/mysql5/mysql/libmysqlclient_r.16.dylib
      Referenced from: /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
      Reason: image not found - /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `<top (required)>'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `require'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `each'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `block in require'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `each'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `require'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler.rb:131:in `require'
    /Users/Fengson/UJ/ProjektZespolowy/wybierzto/config/application.rb:12:in `<top (required)>'
    /Users/Fengson/UJ/ProjektZespolowy/wybierzto/Rakefile:4:in `require'
    /Users/Fengson/UJ/ProjektZespolowy/wybierzto/Rakefile:4:in `<top (required)>'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `eval'
    /Users/Fengson/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `<main>'
    (See full trace by running task with --trace)

另外,如何正确安装MySQL服务器,以便设置默认密码?它要求我在Windows机器上输入密码,但是当我安装MySQL5 + server时,它没有。谢谢!

尝试通过自制软件重新安装mysql。 并重新安装mysql gem
gem install mysql -- --with-mysql-config path/to/mysql_config

相关内容

  • 没有找到相关文章

最新更新