mysql - rails : Why is 'rake secret' giving me an error?

标签 mysql ruby-on-rails ruby

当我尝试运行 rake Secret 命令时,出现此错误:

rake aborted!
NameError: uninitialized constant Mysql2::Client::SECURE_CONNECTION
/Users/myuser/dev/myapp/config/application.rb:7:in `<top (required)>'
/Users/myuser/dev/myapp/config/Rakefile:5:in `require'
/Users/myuser/dev/myapp/config/Rakefile:5:in `<top (required)>'

我有最新版本的 mysql 和 gem mysql2。最近还有其他人偶然发现这个问题吗?我在这里找到的关于这个主题的大多数帖子都有大约五年的历史,并且没有解决这个问题。

最佳答案

在这里回答我自己的问题。该问题是由于 mysql2 gem 版本(0.3.18)与 gemfile 中指定的版本(0.3.16)不匹配造成的。

关于mysql - rails : Why is 'rake secret' giving me an error?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35187403/

相关文章:

php - 使用 unix 选择上个月的行

mysql - 如何从 Google Compute Engine 实例池连接到同一项目中的 Cloud SQL DB?

Mysql更新按行更新数自动计数

ruby-on-rails - 神秘的 Ruby block 行为 : &block vs. {block.call}

php - 从 2 个以上的表中获取列,然后将它们插入到数组中

ruby-on-rails - Ruby on Rails MySQL 数据库迁移中止 Rake

java - OrientDB:如何删除特定的轻量级边缘?

ruby-on-rails - Railscasts 第 362 集 - 导出到 Excel : How to avoid the warning message given by Excel 2010 when opening the file?

ruby - 在 Ruby/Rails 中将 Word 转换为 PDF?

ruby-on-rails - Ruby:未初始化的未定义方法