使用 capistrano 和捆绑器进行 Rails 部署
我想在服务器上部署 Rails 应用程序,其中给出了以下设置。
系统范围内安装的是 ruby 和 rubygems。 作为用户,我安装了捆绑器并将 ~/.gems/bin 添加到路径中。
在 Capfile 中,我将 bundle_cmd 设置为本地安装,例如
set :bundle_cmd, "/home/user/.gems/bin/bundle"
从 cap shell 调用“bundle”会给出以下错误
/usr/lib/ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
/usr/lib/ruby/1.8/rubygems.rb:214:in `activate'
/usr/lib/ruby/1.8/rubygems.rb:1082:in `gem'
/home/user/.gems/bin/bundle:18
有什么想法吗?
好的,我可以以 root 身份安装捆绑程序,但是如果没有 root 权限也可以吗?
I want to deploy an rails app on a server, where the following setup is given.
Systemwide installed is ruby and rubygems.
As user i installed bundler and added the ~/.gems/bin to the path.
inside the Capfile i set bundle_cmd to the local installation like
set :bundle_cmd, "/home/user/.gems/bin/bundle"
calling "bundle" from the cap shell is giving me the following error
/usr/lib/ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
/usr/lib/ruby/1.8/rubygems.rb:214:in `activate'
/usr/lib/ruby/1.8/rubygems.rb:1082:in `gem'
/home/user/.gems/bin/bundle:18
Any ideas?
Okay, i could install bundler as root but is that possible without?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是 cap shell 无法从 bashrc 获取您的设置,例如 GEM_HOME 或捆绑器的路径。
我之前尝试过,
但这对我来说并没有成功。
不过确实有效。
The problem is that the cap shell doesnt get your settings from the bashrc like GEM_HOME or the path of bundler.
I tried it before with
but that didnt do the trick for me.
does work though.