2

我有一个在 Ruby-1.9.3-p392 上工作的项目,我尝试用 Jruby 加载它(jruby-head 与 rvm 一起安装,目前是 jruby 1.7.4.dev (1.9.3p392))

所有 rake 任务都失败并出现以下跟踪

捆绑执行 rake -T
耙中止!
加载错误:pg_ext -- java.lang.RuntimeException:针对无效的 ruby​​ 运行时初始化 C 扩展
org/jruby/RubyKernel.java:1028:in `require'
/home/dmitry/.rvm/gems/jruby-head/gems/pg-0.14.1/lib/pg.rb:4:in `(root)'
org/jruby/RubyKernel.java:1028:in `require'
/home/dmitry/.rvm/gems/jruby-head/gems/bundler-1.3.4/lib/bundler/runtime.rb:1:in `(root)'
org/jruby/RubyArray.java:1614:在“每个”中
/home/dmitry/.rvm/gems/jruby-head/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
org/jruby/RubyArray.java:1614:在“每个”中
/home/dmitry/.rvm/gems/jruby-head/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `require'
/home/dmitry/.rvm/gems/jruby-head/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
/home/dmitry/.rvm/gems/jruby-head/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
org/jruby/RubyKernel.java:1028:in `require'
/home/dmitry/Work/crossArts/config/application.rb:13:in `(root)'
org/jruby/RubyKernel.java:1047:in `load'
/home/dmitry/Work/crossArts/Rakefile:1:in `(root)'
/home/dmitry/Work/crossArts/Rakefile:5:in `(root)'
org/jruby/RubyKernel.java:1047:in `load'
org/jruby/RubyKernel.java:1067:in `eval'
/home/dmitry/.rvm/gems/jruby-head/bin/ruby_noexec_wrapper:14:in `(root)'
4

1 回答 1

0

尝试将 gem 'activerecord-jdbcpostgresql-adapter' 添加到您的 Gemfile 中。这就是我为 puma 2.0.1 和 JRuby 1.7.4 上的 rails 应用程序所做的,它的运行就像一个冠军。

于 2013-06-10T20:17:01.357 回答