部署 Jruby:找不到捆绑器

发布于 2024-12-12 07:51:46 字数 1051 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

失而复得 2024-12-19 07:51:46

这最终成为 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.

俏︾媚 2024-12-19 07:51:46

我在通过jruby -S warble为Tomcat构建war文件时遇到了类似的问题 - 错误消息是:(

warning: skipping bundler (d:/builders3/jruby-1.5.6/lib/ruby/gems/1.8/gems/gems/bundler-1.0.15 does not exist

“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:

warning: skipping bundler (d:/builders3/jruby-1.5.6/lib/ruby/gems/1.8/gems/gems/bundler-1.0.15 does not exist

(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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文