[英]Rails app with JRuby not working
I have an Rails app which was created on Ubuntu. 我有一个在Ubuntu上创建的Rails应用程序。 I wanted to run it on a Mac, but after installing bundles and running
rails s
, I get following errors: 我想在Mac上运行它,但是在安装捆绑包并运行
rails s
,出现以下错误:
LoadError: load error: sqlite3/sqlite3_native -- java.lang.UnsatisfiedLinkError: failed to load shim library, error: dlopen(/Users/home/.rvm/rubies/jruby-1.7.4/lib/native/Darwin/libjruby-cext.dylib, 10): image not found require at org/jruby/RubyKernel.java:1054
LoadError:加载错误:sqlite3 / sqlite3_native-java.lang.UnsatisfiedLinkError:加载Shim库失败,错误:dlopen(/Users/home/.rvm/rubies/jruby-1.7.4/lib/native/Darwin/libjruby- cext.dylib,10):在org / jruby / RubyKernel.java:1054上找不到图像
(root) at /Users/home/.rvm/gems/jruby-1.7.4/gems/sqlite3-1.3.8/lib/sqlite3.rb:6 require at org/jruby/RubyKernel.java:1054 (root) at /Users/home/.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:1 each at org/jruby/RubyArray.java:1617 require at /Users/home/.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72 each at org/jruby/RubyArray.java:1617 require at /Users/home/.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70 require at /Users/home/.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59 require at /Users/home/.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler.rb:132 require at org/jruby/RubyKernel.java:1054 (root) at /Users/home/workSpace/RubyOnRails/sample_app/config/application.rb:13 tap at org/jruby/RubyKernel.java:1860 (root) at /Users/home/.rvm/gems/jruby-1.7.4/gems/railties-3.2.8/lib/rails/commands.rb:1 require at org/jruby/RubyKernel.java:1054 (root) at script/rails:6(root)位于/Users/home/.rvm/gems/jruby-1.7.4/gems/sqlite3-1.3.8/lib/sqlite3.rb:6要求位于org / jruby / RubyKernel.java:1054(root) /Users/home/.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:1分别在org / jruby / RubyArray.java:1617在/ Users需要/home/.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72在org / jruby / RubyArray.java:1617每个都在/ Users / home /.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70要求/Users/home/.rvm/gems/jruby-1.7.4@global /gems/bundler-1.3.5/lib/bundler/runtime.rb:59在/Users/home/.rvm/gems/jruby-1.7.4@global/gems/bundler-1.3.5/lib/bundler中需要。 rb:132在org / jruby / RubyKernel.java:1054(root)在/Users/home/workSpace/RubyOnRails/sample_app/config/application.rb:13在org / jruby / RubyKernel.java:1860(root)在/Users/home/.rvm/gems/jruby-1.7.4/gems/railties-3.2.8/lib/rails/commands.rb:1处需要org / jruby / RubyKernel.java:1054(root)在脚本处/轨道:6
My Gemfile : 我的Gemfile :
source ' https://rubygems.org '
来源' https://rubygems.org '
gem 'rails', '3.2.8'
gem'rails','3.2.8'
gem 'sqlite3'
gem'sqlite3'
group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1'
组:资产做宝石'sass-rails','〜> 3.2.3'宝石'coffee-rails','〜> 3.2.1'
gem 'uglifier', '>= 1.0.3' end
gem'uglifier','> = 1.0.3'结尾
gem 'jquery-rails'
宝石'jquery-rails'
gem 'execjs'
宝石'execjs'
group :test, :development do gem "rspec-rails", "~> 2.0" end
组:test,:development做gem“ rspec-rails”,“〜> 2.0”结束
gem 'spork'
宝石'spork'
gem 'webrat'
宝石'webrat'
gem 'heroku'
宝石“ heroku”
I am using jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_15-b03 [darwin-x86_64]
and Rails 3.2.8 我
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_15-b03 [darwin-x86_64]
和Rails 3.2.8 jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_15-b03 [darwin-x86_64]
使用jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_15-b03 [darwin-x86_64]
The problem stems from the fact that you are trying to use a Ruby gem that relies on a C extension. 问题源于您试图使用依赖于C扩展名的Ruby gem的事实。 From the JRuby wiki :
从JRuby Wiki :
JRuby versions prior to 1.6 did not support Ruby C extensions, and even in 1.6 the support is still "in development" and considered experimental.
1.6之前的JRuby版本不支持Ruby C扩展,甚至在1.6中,该支持仍在“开发中”并被认为是试验性的。 As of 1.7, it has been disabled and will likely be removed.
从1.7开始,它已被禁用并且可能会被删除。
Specifically, the error message states: dlopen(/Users/home/.rvm/rubies/jruby-1.7.4/lib/native/Darwin/libjruby-cext.dylib, 10): image not found
. 具体来说,错误消息指出:
dlopen(/Users/home/.rvm/rubies/jruby-1.7.4/lib/native/Darwin/libjruby-cext.dylib, 10): image not found
。 This is attempting to load the JRuby C extension wrapper, which is not found. 这是试图加载未找到的JRuby C扩展包装器。 I'm not sure of the exact cause here, but perhaps it didn't get installed.
我不确定这里的确切原因,但也许没有安装。
As I see it, you have two main options: 如我所见,您有两个主要选择:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.