简体   繁体   English

Rails 3应用程序部署,Bundler和Rake问题

[英]Rails 3 app deployment, Bundler & Rake issues

Deploying a Rails3 app, and am having some issues getting rake to find the gems installed by 'bundle install --deployment': 部署Rails3应用程序,并且有一些问题需要通过'bundle install --deployment'来查找安装的gem:

$ rake db:migrate
(in /home/jrdev/rails/testapp)
rake aborted!
!!! Missing the mysql2 gem. Add it to your Gemfile: gem ‘mysql2’

But, that gem in is the Gemfile, and is also in the vendor/bundle folder… 但是,那个gem是Gemfile,也在vendor / bundle文件夹中......

$ bundle show mysql2
/home/jrdev/rails/testapp/vendor/bundle/ruby/1.8/gems/mysql2-0.2.6

My .gemrc file: 我的.gemrc文件:

gemhome: /home/jrdev/.gems
gempath:
- /home/jrdev/.gems
- /usr/lib/ruby/gems/1.8

I thought rails3 apps already had the bundler code to detect which gems to use? 我认为rails3应用已经有了捆绑代码来检测要使用哪些宝石? I know I'm using the right rake, too (rake db:migrate --trace starts in /home/jrdev/rails/testapp/vendor/bundle/ruby/1.8/bin/rake). 我知道我也在使用正确的rake(rake db:migrate --trace在/home/jrdev/rails/testapp/vendor/bundle/ruby/1.8/bin/rake中开始)。 Same result using bundler's exec. 使用bundler的exec的结果相同。

:( :(

Wouldn't you freaking know I solve it a minute after asking. 难道你不知道我在问完后一分钟就解决了。

My database.yml file was still calling the 'mysql' adapter instead of 'mysql2'. 我的database.yml文件仍在调用'mysql'适配器而不是'mysql2'。

Still, what an OBSCURE error message! 仍然是一个OBSCURE错误消息!

In /home/jrdev/rails/testapp , you should find a file called Gemfile . /home/jrdev/rails/testapp ,您应该找到一个名为Gemfile的文件。 Look into it and just add the line 查看它,只需添加该行

gem 'mysql2'

somewhere. 某处。

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

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