Ruby `':未定义的方法“raf_电子书”用于main:Object(NoMethodError)-

Ruby `':未定义的方法“raf_电子书”用于main:Object(NoMethodError)-,ruby,methods,undefined,nomethoderror,Ruby,Methods,Undefined,Nomethoderror,尝试使用ruby run.rb运行我的twitter_电子书bot时,我遇到以下错误: Faraday::Builder is now Faraday::RackBuilder. /Users/Rafi/Desktop/my_ebooks/bots.rb:14:in `<top (required)>': undefined method `“raf_ebooks' for main:Object (NoMethodError) from run.rb:33:in `requ

尝试使用ruby run.rb运行我的twitter_电子书bot时,我遇到以下错误:

Faraday::Builder is now Faraday::RackBuilder.
/Users/Rafi/Desktop/my_ebooks/bots.rb:14:in `<top (required)>': undefined method `“raf_ebooks' for main:Object (NoMethodError)
    from run.rb:33:in `require_relative'
    from run.rb:33:in `<main>'

TWITTER_用户名值的开头引号不是一个常规的引号,它是一种聪明的引号。因此Ruby没有将其识别为字符串,并且变得相当混乱。

Ruby没有识别出卷曲的引号。当你使用它时,会出现这种情况,试图获得想象力

TWITTER_USERNAME = “raf_ebooks" # Ebooks account username
TEXT_MODEL_NAME = “raf_ebooks" # This should be the name of the text model
请注意突出显示的语法错误。它们应该是普通的直引号:

TWITTER_USERNAME = "raf_ebooks" # Ebooks account username
TEXT_MODEL_NAME = "raf_ebooks" # This should be the name of the text model
好多了


给自己找一个像样的编辑器。TextEdit不适合编码。TextMate和Sublime Text是流行的商业编辑器。GitHub是一个免费的编辑器,也很不错。

你使用的是什么文本编辑器?@Im只是使用TextEdit,Mac的默认文本编辑器。
TWITTER_USERNAME = "raf_ebooks" # Ebooks account username
TEXT_MODEL_NAME = "raf_ebooks" # This should be the name of the text model