cap deploy:migrations fails with Could not locate Gemfile

耗尽温柔 提交于 2019-12-11 06:25:43

问题


I'm working on my first rails deployment and having a problem I can't figure out. mac osx 10.8.2 ruby 1.8.7 Rails 3.2.6 rvm 1.17.2

I've been following this tutorial http://brandnewrails.wordpress.com/ and got stuck on 7c. I set it all up in RVM, got git running on the server, ran bundle install in the app, and wrote the Capistrano recipe in my_app/config/deploy.rb

Then I ran:

$ capify . no problem

$ cap deploy:setup no errors

$ cap deploy:check returned You appear to have all necessary dependencies installed

$ cap deploy:migrations is where the problem happens. After successfully running a bunch of the commands, capistrano fails. See below:

2012-12-10 00:43:56 executing `bundle_install'
* executing "cd /home/{servername}/party/releases/20121209134354 && bundle install --path vendor/bundle"
servers: ["{servername}"]
[{servername}] executing command
** [out :: {servername}] Could not locate Gemfile
command finished in 694ms

failed: "sh -c 'cd /home/alexchee/party/releases/20121209134354 && bundle install --path vendor/bundle'" on {servername}

Does anyone know what to do? When I check the app directory, the Gemfile is there. Any ideas or further questions?


回答1:


The inability of capistrano to locate a Gemfile in this case seems to be a symptom of not having initiated git in the app locally, that is on my own computer.

My hunch is that since Gemfile is the first file in the list above, that is why it created an error first. If the program had continued, it would have probably had other errors as well.

Even if git is running on the server and the app is bundled up correctly, you must also initiate git locally and direct it to the appropriate files on your server in order for the deploy to work.

Great instructions are listed here: http://brandnewrails.wordpress.com/2012/10/14/lesson-7b/



来源:https://stackoverflow.com/questions/13788286/cap-deploymigrations-fails-with-could-not-locate-gemfile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!