mysql - 无法启动 WEBRick Web 服务器 - Ruby 抛出 MySQL 错误

标签 mysql ruby-on-rails ruby

我是使用 64 位计算机的 Windows 8.1 用户。但是,我已经在 32 位版本中安装了与 Ruby 有关的所有内容,以防止互联网上出现那些著名的错误。这还不够……我在尝试启动 Rails 的提到 MySQL 的 WEBBrick 服务器时仍然收到一个奇怪的错误:

C:\Users\User\Workspace\Ruby\ruby_learn>rails server
C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2.rb:8:in `require':
Incorrect MySQL client library version! This gem was compiled for 6.1.3 but the
client library is 6.0.0. (RuntimeError)
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2.rb:8:i
n `<top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runti
me.rb:76:in `require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runti
me.rb:76:in `block (2 levels) in require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runti
me.rb:72:in `each'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runti
me.rb:72:in `block in require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runti
me.rb:61:in `each'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runti
me.rb:61:in `require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler.rb:13
1:in `require'
        from C:/Users/User/Workspace/Ruby/ruby_learn/config/application.rb:7:in
`<top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/comman
ds.rb:76:in `require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/comman
ds.rb:76:in `block in <top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/comman
ds.rb:73:in `tap'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/comman
ds.rb:73:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

前几天我确实在让 MySQL 工作时遇到了一些麻烦,但我通过使用 MySQL C 连接器 6.0.2 做了一些我不理解的事情解决了它,然后早些时候我不能获取要安装的包,因为它要求安装 mysql2 0.3.15,但显然我有 mysql2 0.3.13。我不确定哪里错了。因此,我从 dev.mysql.com 获得的更新后的 C 连接器解决了捆绑问题,但现在 Web 服务器无法运行。

我不知道设置 Ruby on Rails 会如此痛苦,但我仍然对此充满动力,我需要帮助才能继续。

谢谢。

最佳答案

尝试看看这个答案是否对您有帮助mysql2 gem compiled for wrong mysql client library :

There's a helpful message that is shown when you gem install mysql2. Unfortunately, if you install the gem with Bundler, Bundler eats the message

关于mysql - 无法启动 WEBRick Web 服务器 - Ruby 抛出 MySQL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21644356/

相关文章:

ruby - 无法加载应用程序。不兼容的库版本

mysql - 如何在 MySQL 中获得减去 6 周的时间戳?

python - 如何在 ruby​​ 中进行图像处理? Ruby 中没有 OpenCv?

ruby-on-rails - Rails RSpec 测试 : Undefined method 'deliver' for nil:NilClass

ruby-on-rails - ActiveRecord 不知道时区?

ruby - 我在使用多用户 RVM 安装安装 ruby 时遇到问题

mysql - 加入右表限制

php - 导出MySQL数据库并导入到PostgreSQL数据库

mysql - 如何让 Shiny 的应用程序与云关系数据库(在 MySQL 中)对话?

ruby-on-rails - 在rails中生成一个自动增量字段