2

最初に「roo」が必要で、次に「google-search」が必要な場合、エラーが発生します

TypeError: Google is not a module

繰り返しますが、最初に「google-search」が必要で、次に「roo」が必要です。このエラーが発生します

TypeError: Google is not a class

irbで実際に起こったことについては、以下を参照してください

{12:30}[1.9.3]~ ➭ irb
1.9.3-p0 :001 > require 'roo'
 => true
1.9.3-p0 :002 > require 'google-search'
TypeError: Google is not a module
        from /home/sagar/.rvm/gems/ruby-1.9.3-p0/gems/google-search-1.0.3/lib/google-search/version.rb:2:in `<top (required)>'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
        from /home/sagar/.rvm/gems/ruby-1.9.3-p0/gems/google-search-1.0.3/lib/google-search.rb:26:in `<top (required)>'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
        from (irb):2
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'
1.9.3-p0 :003 > exit
{12:30}[1.9.3]~ ➭ irb
1.9.3-p0 :001 > require 'google-search'
 => true
1.9.3-p0 :002 > require 'roo'
TypeError: Google is not a class
        from /home/sagar/.rvm/gems/ruby-1.9.3-p0/gems/roo-1.10.1/lib/roo/google.rb:7:in `<top (required)>'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
        from /home/sagar/.rvm/gems/ruby-1.9.3-p0/gems/roo-1.10.1/lib/roo.rb:74:in `<top (required)>'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
        from (irb):2
        from /home/sagar/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'
4

1 に答える 1

4

これに対する修正は、Roo名前空間を持つことです。roogemgithubを変更しました。roo-1.4.0.gemをgithubリポジトリからダウンロードして、このバージョンのrooをインストールできます。

于 2013-01-17T07:21:31.953 に答える