没有这样的文件加载 - 超市

时间:2012-05-29 02:16:26

标签: ruby-on-rails ruby

我想使用android-market-api jruby版本。 但是当我安装它并想要使用它时。

导致低于负载错误。

我使用https://github.com/jberkel/supermarket

java版本在这里:http://code.google.com/p/android-market-api/

谁能帮助我?

$ rvm use jruby

$ gem install supermarket
Fetching: json-1.5.0-java.gem (100%)
Fetching: json-jruby-1.5.0-java.gem (100%)
Fetching: supermarket-0.0.5-universal-java.gem (100%)
Successfully installed json-jruby-1.5.0-java
Successfully installed supermarket-0.0.5-universal-java
3 gems installed

$ irb

jruby-1.6.5 :001 > require 'supermarket'
LoadError: no such file to load -- supermarket
      from org/jruby/RubyKernel.java:1038:in `require'
      from (irb):1:in `evaluate'
      from org/jruby/RubyKernel.java:1088:in `eval'
      from /home/grant/.rvm/rubies/jruby-1.6.5/lib/ruby/1.8/irb.rb:158:in
`eval_input'
      from /home/grant/.rvm/rubies/jruby-1.6.5/lib/ruby/1.8/irb.rb:271:in
`signal_status'
      from /home/grant/.rvm/rubies/jruby-1.6.5/lib/ruby/1.8/irb.rb:155:in
`eval_input'
      from org/jruby/RubyKernel.java:1420:in `loop'
      from org/jruby/RubyKernel.java:1192:in `catch'
      from /home/grant/.rvm/rubies/jruby-1.6.5/lib/ruby/1.8/irb.rb:154:in
`eval_input'
      from /home/grant/.rvm/rubies/jruby-1.6.5/lib/ruby/1.8/irb.rb:71:in
`start'
      from org/jruby/RubyKernel.java:1192:in `catch'
      from /home/grant/.rvm/rubies/jruby-1.6.5/lib/ruby/1.8/irb.rb:70:in
`start'
      from /home/grant/.rvm/rubies/jruby-1.6.5/bin/irb:17:in `(root)' 

1 个答案:

答案 0 :(得分:3)

第一

irb(main):003:0> require 'supermarket'
LoadError: no such file to load -- supermarket

然后:

irb(main):004:0> require 'rubygems'
=> true
irb(main):005:0> require 'supermarket'
=> true

您必须先require rubygemsrequire命令以rubygems的方式运行。

更新正如@RobertRouse在评论中指出的那样,您可以通过在jirb模式下运行--1.9来达到同样的效果:

$ jruby --1.9 -S irb
irb(main):001:0> require 'supermarket'
=> true