简体   繁体   English

Rails:为什么“ rake secret”给我一个错误?

[英]Rails: Why is 'rake secret' giving me an error?

I'm trying to run the rake secret command when I get this error: 出现此错误时,我正在尝试运行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)>'

I've got the latest version of mysql and the gem mysql2. 我有最新版本的mysql和gem mysql2。 Has anyone else stumbled upon this issue recently? 最近有没有其他人偶然发现这个问题? Most posts on this topic I've found here are some five years old and doesn't fix this problem. 我在这里找到的有关该主题的大多数文章都已经有五年历史了,并且不能解决此问题。

Answering my own question here. 在这里回答我自己的问题。 This problem was caused by a mismatch between the mysql2 gem version (0.3.18) and the version specified in the gemfile (0.3.16). 此问题是由mysql2 gem版本(0.3.18)和gemfile(0.3.16)中指定的版本不匹配引起的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM