该程序的第一行是错误发生的地方,
require 'grackle'
这是我今天早上在课堂上写的代码,整个程序(以'require grackle'开头)我能够阅读推文并直接从命令行编写它们。现在我回到家并尝试在我的 mac(来自 irb)上运行完全相同的程序并得到这个:
source "grackle.rb"
>> require 'grackle'
NameError: uninitialized constant Grackle
from ./grackle.rb:5
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from grackle.rb:2
>> require 'json'
=> false
>> require 'highline/import'
=> false
>>
?> $client = Grackle::Client.new( :auth => {
...(Oauth keys)...
NameError: uninitialized constant Grackle
from grackle.rb:6
etc etc, every time Grackle gets called a similar error occurs
在它尝试运行第一行之后。然后,这个初始错误会触发一连串错误。
我已经安装了 grackle gem。这里发生了什么?