uninitialized constant Twitter (NameError)

倖福魔咒の 提交于 2019-12-02 01:21:36

If you are running Ruby 1.8.x you should be able to solve your problem by renaming your own script to anything different than twitter.rb.

This is because the main file in the twitter gem is named exactly like this and your file probably overrides it in combined virtual file system that the $LOAD_PATH order creates. Before Ruby 1.9.x, require did not only load from library directories, but preferred to load files relative to the current working directory of your process, in this case, the directory where your script lies in.

Do not name your file as twitter.rb, also make sure there is no other file in the same directory with the name twitter.rb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!