配置Ruby应用程序的数据库连接

时间:2018-06-21 13:30:46

标签: ruby

当我尝试运行Ruby应用程序时出现此异常:

/Users/test/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require': dlopen(/Users/test/.rvm/gems/ruby-2.2.2/gems/mysql2-0.4.9/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/opt/mysql/lib/libmysqlclient.20.dylib (LoadError)
  Referenced from: /Users/test/.rvm/gems/ruby-2.2.2/gems/mysql2-0.4.9/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/test/.rvm/gems/ruby-2.2.2/gems/mysql2-0.4.9/lib/mysql2/mysql2.bundle
    from /Users/test/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
    from /Users/test/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/test/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'

我成功运行了gem install mysql2,但是当我再次运行该应用程序时,我遇到了同样的错误。

您能建议我如何解决此问题吗?

0 个答案:

没有答案