Can't run ruby scripts on Cloud9



I installed all the required gems in the command line and then I ran the script. I always get “rubyscraper.rb:8:in <main>': undefined local variable or methodhttparty’ for main:Object (NameError)” for all of the methods. WTF???

require 'httparty’
require 'nokogiri’
require 'pry’
require 'JSON’
require ‘csv’

page = httparty.get(‘’)
puts page.response.body
puts 1+1


Per httparty's documentation, you need to refer to it as HTTParty in your code, so:

page = httparty.get('')

Should become:

page = HTTParty.get('')


The issue looked like Cloud9 was not loading the correct library path of the installed gems. I created a new workspace and created a new folder/directory to install the gems to get it working.