部署 Jruby:找不到捆绑器
LoadError: no such file to load --bundler/setup
尝试将 Rails 应用程序部署为 .war
我可以通过命令行以我的部署用户身份运行它,但是在机器启动时以 root 身份启动应用程序服务器会导致错误。
我已经在 /etc/environment 中设置了 GEM_HOME 但没有帮助。
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.9
- RUBY VERSION: 1.9.2 (2011-10-17 patchlevel 136) [java]
- INSTALLATION DIRECTORY: /usr/local/rbenv/versions/jruby-1_6-latest/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/rbenv/versions/jruby-1_6-latest/bin/jruby
- EXECUTABLE DIRECTORY: /usr/local/rbenv/versions/jruby-1_6-latest/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
- GEM PATHS:
- /usr/local/rbenv/versions/jruby-1_6-latest/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --env-shebang"
- "update" => "--no-rdoc --no-ri --env-shebang"
- REMOTE SOURCES:
- http://rubygems.org/
LoadError: no such file to load -- bundler/setup
Trying to deploy a rails app as a .war
I can get it running via command line as my deploy user, but starting the app server as root when the machine boots lead to the error.
I've set my GEM_HOME in /etc/environment but it doesn't help.
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.9
- RUBY VERSION: 1.9.2 (2011-10-17 patchlevel 136) [java]
- INSTALLATION DIRECTORY: /usr/local/rbenv/versions/jruby-1_6-latest/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/rbenv/versions/jruby-1_6-latest/bin/jruby
- EXECUTABLE DIRECTORY: /usr/local/rbenv/versions/jruby-1_6-latest/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
- GEM PATHS:
- /usr/local/rbenv/versions/jruby-1_6-latest/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --env-shebang"
- "update" => "--no-rdoc --no-ri --env-shebang"
- REMOTE SOURCES:
- http://rubygems.org/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这最终成为 Warbler 的一个问题,特别是 Warbler 对您使用的 Rubygems 版本做出了一些假设。
如果您使用的是最新的稳定版 Warbler (1.3.2),请使用 JRuby 1.6.4。如果您使用的是 JRuby 1.6.5,请使用 github 上的最新 Warbler。
This ended up being an issue with Warbler, specifically Warbler makes some assumptions about which version of Rubygems you're using.
If you're using latest stable Warbler (1.3.2), use JRuby 1.6.4. If you are using JRuby 1.6.5, use the latest Warbler from github.
我在通过
jruby -S warble
为Tomcat构建war文件时遇到了类似的问题 - 错误消息是:(“gems/gems”部分,顺便说一句,是假的;不确定它是如何构建该路径的。 )
war 文件(显然)已构建,但在尝试部署到 Tomcat 时出现严重错误:
找不到捆绑器/安装程序
。我的环境:JRuby 1.5.6,Ruby 1.8.7,Rails 3.0.15。 gem - v #=> 1.3.6。
我终于得到了正确构建 war 文件并部署的方法 - 关键的更改是在 Gemfile 中将 warbler 设置为 1.3.2,并运行“bundle exec warble”。
I had similar issue building a war file for Tomcat, via
jruby -S warble
- error message was:(That "gems/gems" part, btw, is bogus; not sure how it constructed that path.)
The war file (apparently) got built, but in trying to deploy to Tomcat it gives severe error:
can't find bundler/setup
.My environment: JRuby 1.5.6, Ruby 1.8.7, Rails 3.0.15. gem - v #=> 1.3.6.
I finally got this to both build the war file properly and deploy - the key change was to set warbler to 1.3.2 in Gemfile, and run "bundle exec warble".