[英]LoadError: cannot load such file — mysql2/mysql2 - on rake db:create
When i run rake db:create
, I get this error: 当我运行
rake db:create
,出现以下错误:
LoadError: cannot load such file -- mysql2/mysql2
/Users/vitorqueiroz/dev/pipeline/config/application.rb:10:in `<top (required)>'
/Users/vitorqueiroz/dev/pipeline/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
I had to mannualy install mysql2 gem because the gemfile specifies the version '0.3.20' 我必须手动安装mysql2 gem,因为gemfile指定了版本“ 0.3.20”
I ran gem install mysql2 -v '0.3.20' -- --srcdir=/usr/local/include/mysql
我运行了
gem install mysql2 -v '0.3.20' -- --srcdir=/usr/local/include/mysql
Bundle install runs fine, and says everything is installed. 捆绑安装运行良好,并且说所有东西都已安装。
bundle list mysql2
evaluates to: bundle list mysql2
评估为:
/Users/vitorqueiroz/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/mysql2-0.3.20
-- -
Any alternatives? 有其他选择吗?
You can try 你可以试试
bundle exec rake db:create
to be sure that bundled gems are loaded. 确保已装入捆绑的宝石。
https://bundler.io/man/bundle-exec.1.html https://bundler.io/man/bundle-exec.1.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.