How do I use frozen Capistrano part 2?

孤街浪徒 提交于 2019-12-11 19:07:38

问题


Following on from my question on using frozen Capistrano a couple of days back I'm still having issues running Capistrano frozen in my vendor folder.

When I try and run my frozen version of cap

ruby -r rubygems ./vendor/gems/capistrano-2.5.2/bin/cap deploy-with-migrations

I get an error

... RubyGem version error: net-ssh(1.0.8 not >= 2.0.0) (Gem::LoadError) ...

I have net-ssh-2.0.4 frozen in my vendor folder as I knew it was a dependency so how do I make use of it?

I'd hoped adding my vendor folder to my .gemrc file under the gempath: would have done the trick, but it hasn't. 'gem environment' shows the vendor path, but 'gem list' doesn't show the gems in the vendor folder.

Any ideas?


回答1:


In the end I decided not to freeze Capistrano and dependancies to my vendor gems directory as they weren't gems used by my application - they were used to deploy my application.

Instead I locally installed them on my hosting account and all worked fine.




回答2:


If you want to completely avoid the system-installed gems (which isn't a bad idea if you don't have control over them), I'd install a copy of rubygems to vendor directory.

Set GEM_PATH and GEM_HOME environment variables to /path/to/your/vendor/gems directory, and then install rubygems and go from there.



来源:https://stackoverflow.com/questions/339613/how-do-i-use-frozen-capistrano-part-2

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