Unable to use HTTParty; Uninitialized constant or cannot load such file errors

971 views
Skip to first unread message

Mike Kreisher

unread,
Mar 29, 2015, 12:36:27 PM3/29/15
to httpar...@googlegroups.com
I've been trying to figure this one out for about a week now. I'm trying to use HTTParty in a gem I'm writing and I keep flipping back and forth between two errors. If I do not require httparty at the top of my class file, I receive the following error:

uninitialized constant Reporting::GitlabIssue::HTTParty (NameError)

at the include line:
module Reporting
 
class GitlabIssue
    include
HTTParty
...


Looking around it seems obvious from everyone else receiving this error that I need to require 'httparty' before the start of the class. So I do that and I receive this error:

cannot load such file -- httparty (LoadError)

I have the gem listed in my gemspec as

spec.add_dependency 'httparty"

and when I run bundle I see the httparty gem listed as being installed and using version 0.13.3.

When I'm running IRB, I can require 'httparty' and it returns true and a gem list --local shows as having the aforementioned version installed on my machine.

Any ideas as to what could be going on here? I've been going crazy looking for a solution and I seem to be running around in circles.

Here's some system info:
ruby version = ruby 2.1.0p0 [x86_64-linux]
rails version = Rails 4.1.1

 

Reply all
Reply to author
Forward
0 new messages