1

我想使用 rjb 来调用standford parser。我已经设法为 rjb 安装 gem 并按照 rjb 网站中的建议设置 JAVA_HOME 路径。

     gem install rjb
     Building native extensions.  This could take a while...
     Successfully installed rjb-1.4.3
     1 gem installed
     Installing ri documentation for rjb-1.4.3...
     Installing RDoc documentation for rjb-1.4.3...
     [root@avinash shoutout_railsengine]# ruby -v -e "p ENV['JAVA_HOME']"
        ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
     "/usr/java/jdk1.7.0/"
     [root@avinash shoutout_railsengine]# ruby -v -e "p ENV['JAVA_HOME']"
     ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
     "/usr/java/jdk1.7.0/"
     [root@avinash shoutout_railsengine]# ruby -v -e "p ENV['JAVA_HOME']"
     ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
     "/usr/java/jdk1.7.0/"
     [root@avinash shoutout_railsengine]# ruby -d -rubygems -rrjb -e 'Rjb::load'
       Exception `LoadError' at <internal:lib/rubygems/custom_require>:29 - no such   file to load -- rubygems/defaults/operating_system
     Exception `LoadError' at <internal:lib/rubygems/custom_require>:37 - no such file to load -- rubygems/defaults/operating_system
     Exception `LoadError' at <internal:lib/rubygems/custom_require>:29 - no such file to load -- rubygems/defaults/ruby
     Exception `LoadError' at <internal:lib/rubygems/custom_require>:37 - no such file to load -- rubygems/defaults/ruby
     Exception `LoadError' at <internal:lib/rubygems/custom_require>:29 - no such file to load -- rjb
    Exception `LoadError' at <internal:lib/rubygems/custom_require>:37 - no such file to load -- rjb
  <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- rjb (LoadError)
     from <internal:lib/rubygems/custom_require>:29:in `require'
 [root@avinash shoutout_railsengine]# irb
  irb(main):001:0> require 'rjb'
  LoadError: no such file to load -- rjb
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from (irb):1
    from /usr/local/bin/irb:12:in `<main>'

有人可以告诉我有什么问题吗?

4

1 回答 1

0

require 'rubygems'先试试require 'rjb'

于 2013-09-25T18:12:20.027 回答