我正在使用jruby
模式1.9
。
➜ nittresults git:(master) ✗ ruby -v
jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-05-01 26e08ba) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24) [darwin-x86_64-java]
➜ nittresults git:(master) ✗ which gem
gem: aliased to jruby --1.9 -S gem
➜ nittresults git:(master) ✗ which irb
irb: aliased to jruby --1.9 -S irb
我创建了一个 gem nittresults,安装后我无法在 irb 中加载它。错误信息如下所示
➜ nittresults git:(master) ✗ gem list | grep -i nitt
nittresults (0.0.1)
➜ nittresults git:(master) ✗ irb
irb(main):001:0> require 'nittresults'
LoadError: no such file to load -- nittresults
from org/jruby/RubyKernel.java:1042:in `require'
from /Library/Frameworks/JRuby.framework/Versions/Current/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):1:in `evaluate'
from org/jruby/RubyKernel.java:1088:in `eval'
from org/jruby/RubyKernel.java:1410:in `loop'
from org/jruby/RubyKernel.java:1197:in `catch'
from org/jruby/RubyKernel.java:1197:in `catch'
from /Library/Frameworks/JRuby.framework/Versions/Current/bin/jirb:13:in `(root)'
我怎样才能让它加载到 irb 内部?我在osx雪豹10.6.8上。
这是输出 oggem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.2 (2012-05-01 patchlevel 312) [java]
- INSTALLATION DIRECTORY: /Library/Frameworks/JRuby.framework/Gems/1.9
- RUBY EXECUTABLE: /Library/Frameworks/JRuby.framework/Versions/Current/bin/jruby
- EXECUTABLE DIRECTORY: /Library/Frameworks/JRuby.framework/Versions/Current/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
- GEM PATHS:
- /Library/Frameworks/JRuby.framework/Gems/1.9
- /Users/User/.gem/jruby/1.9
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- http://rubygems.org/
这是输出puts $:
➜ nittresults git:(master) ✗ irb
irb(main):001:0> puts $:
/Library/Frameworks/JRuby.framework/Versions/Current/lib/ruby/site_ruby/1.9
/Library/Frameworks/JRuby.framework/Versions/Current/lib/ruby/site_ruby/shared
/Library/Frameworks/JRuby.framework/Versions/Current/lib/ruby/site_ruby/1.8
/Library/Frameworks/JRuby.framework/Versions/Current/lib/ruby/1.9
=> nil