2016-09-15 66 views
2

我在我的ubuntu机器上安装了jruby 1.7.16和rails 4.1.8。我现有的jruby应用程序,我想运行使用webbrick服务器,但我无法运行它。每当我开始webrick服务器使用命令轨s我越来越低于错误。Jruby:无法在jruby on rails应用程序中启动webrick服务器

successful load of fcntl 
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbc-adapter'. 
Gem Load Error is: private method `require' called for Kernel:Module 
Backtrace for gem load error is: 
/home/administrator/.rvm/gems/[email protected]/gems/bundler-1.13.1/lib/bundler/runtime.rb:91:in `require' 
org/jruby/RubyArray.java:1613:in `each' 
/home/administrator/.rvm/gems/[email protected]/gems/bundler-1.13.1/lib/bundler/runtime.rb:86:in `require' 
org/jruby/RubyArray.java:1613:in `each' 
/home/administrator/.rvm/gems/[email protected]/gems/bundler-1.13.1/lib/bundler/runtime.rb:75:in `require' 
/home/administrator/.rvm/gems/[email protected]/gems/bundler-1.13.1/lib/bundler.rb:106:in `require' 
/home/administrator/Desktop/vitality_iq_project/analytics-core/config/application.rb:19:in `(root)' 
org/jruby/RubyKernel.java:1065:in `require' 
/home/administrator/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:1:in `(root)' 
org/jruby/RubyKernel.java:1880:in `tap' 
/home/administrator/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:79:in `server' 
/home/administrator/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:76:in `server' 
/home/administrator/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!' 
org/jruby/RubyKernel.java:1065:in `require' 
script/rails:6:in `(root)' 
Bundler Error Backtrace: 

     require at /home/administrator/.rvm/gems/[email protected]/gems/bundler-1.13.1/lib/bundler/runtime.rb:95 
      each at org/jruby/RubyArray.java:1613 
     require at /home/administrator/.rvm/gems/[email protected]/gems/bundler-1.13.1/lib/bundler/runtime.rb:86 
      each at org/jruby/RubyArray.java:1613 
     require at /home/administrator/.rvm/gems/[email protected]/gems/bundler-1.13.1/lib/bundler/runtime.rb:75 
     require at /home/administrator/.rvm/gems/[email protected]/gems/bundler-1.13.1/lib/bundler.rb:106 
     (root) at /home/administrator/Desktop/vitality_iq_project/analytics-core/config/application.rb:19 
     require at org/jruby/RubyKernel.java:1065 
     (root) at /home/administrator/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:1 
      tap at org/jruby/RubyKernel.java:1880 
     server at /home/administrator/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:79 
     server at /home/administrator/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:76 
    run_command! at /home/administrator/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40 
     require at org/jruby/RubyKernel.java:1065 
     (root) at script/rails:6 

下面是我的JRuby版本信息

jruby -v 
jruby 1.7.16 (1.9.3p392) 2014-09-25 575b395 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_101-b13 +jit [linux-amd64] 

和我的rails版本是4.1.8。请帮助我使用rails在Jruby应用程序中启动服务器。

感谢,

回答

1

有带捆扎机1.13.1的一个问题,是造成这一点 - 他们基本上是移植require方法,而在JRuby的1.7可视性缺陷从而使得Kernel::require私人。

3件事你可以做:

  1. 变化Kernel.require知名度是公众(加载捆扎机后)
  2. 降级到捆扎机1.12
  3. 升级到JRuby的1.7.26(尚未发布)
+0

Kares ..你救了我的命........................ 1000多亏了你....爱你亲爱的.... :) –