0

我正在尝试在 ChiliProject(Redmine fork,Rails 2.3 应用程序)上使用 warbler 将其部署在 Java Jetty Web 服务器中。但是当我在项目根文件夹中运行 warble 时,它​​会失败并显示给定的错误消息:

$ warble  --trace
warble aborted!
undefined method `gems' for #<Rails::VendorGemSourceIndex:0x2e9267fe>
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:260:in `all_specs'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/source.rb:172:in `installed_specs'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/source.rb:162:in `fetch_specs'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/index.rb:7:in `build'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/source.rb:161:in `fetch_specs'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/source.rb:70:in `specs'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/definition.rb:159:in `index'
org/jruby/RubyArray.java:1603:in `each'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/definition.rb:158:in `index'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/index.rb:7:in `build'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/definition.rb:157:in `index'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/definition.rb:151:in `resolve'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/definition.rb:90:in `specs'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/definition.rb:135:in `specs_for'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/bundler-1.0.15/lib/bundler/definition.rb:124:in `requested_specs'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/traits/bundler.rb:102:in `bundler_specs'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/traits/bundler.rb:38:in `add_bundler_gems'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/traits/bundler.rb:29:in `after_configure'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/traits.rb:32:in `after_configure'
org/jruby/RubyArray.java:1603:in `each'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/traits.rb:32:in `after_configure'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/config.rb:172:in `initialize'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/task.rb:48:in `initialize'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/application.rb:27:in `load_rakefile'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:61:in `run'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/lib/warbler/application.rb:70:in `run'
/Users/razenha/.rvm/gems/jruby-1.6.3/gems/warbler-1.3.2/bin/warble:11:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
/Users/razenha/.rvm/gems/jruby-1.6.3/bin/warble:19:in `(root)'

我正在使用 JRuby 1.6.3、JDK 1.6、warbler 1.3.2 和 ChiliProject 2.2.0。

4

1 回答 1

0

首先,我很遗憾不得不让您失望,因为我们还没有完全支持 JRuby。另一方面,可能只有“唯一”的编码问题需要解决,所以如果你小心的话,一切都会好起来的。

也就是说,看起来 Rails 2.3 在这里与 Bundler 配合得不太好。如果您将以下文件放入lib/redmine/core_ext/vendor_gem_source_index.rb您的 ChiliProject 目录,您应该能够运行 warbler。

class Rails::VendorGemSourceIndex
  def gems
    @installed_source_index.gems.merge @vendor_source_index.gems
  end
end

您仍然需要配置 warbler 以使用正确的捆绑程序组。由于 warbler 在这里做它自己的事情(而且我还没有将 warbler 与捆绑的应用程序一起使用),您可能需要了解如何配置它。查看Gemfile和我们的Bundler 页面了解更多信息。

如果你够唠叨的话,我们可能有一天会正式支持这一点 :) 此外,在我们自己的论坛IRC上可以找到更友好的人。

于 2011-09-10T12:18:20.823 回答