search

Home  >  Q&A  >  body text

ruby - rails server 启动报错,内详

$ rails server

/Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.17/lib/mysql2.rb:8:in `require': dlopen(/Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.17/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.17/lib/mysql2/mysql2.bundle
  Reason: unsafe use of relative rpath libmysqlclient.18.dylib in /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.17/lib/mysql2/mysql2.bundle with restricted binary - /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.17/lib/mysql2/mysql2.bundle
    from /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.17/lib/mysql2.rb:8:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
    from /Users/xxzyjy/zzetao/xxzedu/config/application.rb:7:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:78:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'
伊谢尔伦伊谢尔伦2760 days ago630

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-24 09:12:19

    OSX 10.11 right? Try this

    sudo install_name_tool -change libmysqlclient.18.dylib \
      /usr/local/mysql/lib/libmysqlclient.18.dylib \
      /Library/Python/2.7/site-packages/_mysql.so

    reply
    0
  • Cancelreply