ruby-on-rails - rails : Specified 'mysql2' for database adapter but the gem is not loaded

标签 ruby-on-rails ruby linux ruby-on-rails-4 mysql2

显然有一个线程可以解决这个问题。但是我已经尝试运行解决方案中给出的那些命令。由于某种原因,我仍然遇到同样的错误。

我跑 gem install mysql2 -v 0.3.18

接着是 捆绑安装

在我的终端上。然后我通过键入启动服务器 rails 服务器

打开 localhost:3000。我收到同样的错误。

Specified 'mysql2' for database adapter, but the gem is not loaded. Add gem 'mysql2' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

任何帮助将不胜感激。

最佳答案

将以下内容添加到您的Gemfile:

gem 'mysql2', '~> 0.3.18'

然后运行:

bundle install

关于ruby-on-rails - rails : Specified 'mysql2' for database adapter but the gem is not loaded,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32835912/

相关文章:

ruby - Bosh stemcell Ubuntu Ruby,与/var/vcap/bosh/lib/ruby 冲突(LoadError)

ruby - shift_age 'w' 的 Ruby 记录器有什么作用?

linux - 如何在子目录 linux mint 中安装 pimcore?

linux - AWK If/Else 条件问题

php - 如何确保php对wp专用服务器有写权限

ruby-on-rails - Rails - 简单形式 :collection 中默认选择的单选按钮

mysql - Rails 5 注册期间出现 'nomethod' 错误

ruby-on-rails - 一个月前得到,但总是在一个月的第 15 天

ruby-on-rails - 我想知道 Ruby 或 Ruby on Rails(框架)中是否有 Head- and Tail-methods

ruby - 如何检查 Ruby 对象的方法?