gem install not working?

Sean's Avatar


26 Jan, 2012 01:10 AM


I've been doing some gem development, but am running into an issue when testing out my gem in an application. The build process seems to work fine, generating the .gem file but when I try to install the gem, it does not appear in my local gem list.


$ sudo gem install ./pixcaptcha-1.0.gem
Successfully installed pixcaptcha-1.0

$ gem list p

*** LOCAL GEMS ***

passenger (3.0.8, 3.0.7)
Platform (0.4.0)
plucky (0.3.8)
polyglot (0.3.3, 0.3.2, 0.3.1)
pyu-ruby-sasl (

Even trying to install something like jeweler says that it was successfully installed, but it does not appear in my local gem list. Should I expect gem install to install them to my local list? Am I missing a step?

  1. 1 Posted by Luis Lavena on 26 Jan, 2012 03:58 AM

    Luis Lavena's Avatar

    Are you using rvm? Is "gem" between your user and sudo the same? What does
    sudo gem list p result? What is your gemspec?

  2. 2 Posted by Sean on 01 Feb, 2012 08:38 PM

    Sean's Avatar


    Sorry for the late reply.

    I think you're on to something, when I do sudo gem list p, my pixcaptcha does come up. Perhaps my application could not see the gem because I installed it using sudo and not simply gem install ./pixcaptcha-1.0.gem?

    $ sudo gem list p
    *** LOCAL GEMS ***
    passenger (3.0.9, 3.0.7)
    pixcaptcha (1.0)
    Platform (0.4.0)
    plucky (0.4.4, 0.3.8)
    polyglot (0.3.3, 0.3.2, 0.3.1)
    pyu-ruby-sasl (`

    I have been using sudo gem install because of permissions (to the ruby directory. I think it is a system wide install.

    I am using rvm 1.7.2, and I will attach the pixcaptcha gemspec to the post. I was working on getting jeweler installed, so I may have made some goofs in the gemspec while manually editing (I do realize the file says "DO NOT EDIT THIS FILE DIRECTLY" :) )

    should I grant myself access to write to the ~/.rvm/gems/ruby-1.9.2-p290 directory to install my gem for my application to use?

    Let me know if there is any other information I can provide to help out.

  3. Support Staff 3 Posted by Eric Hodel on 02 Feb, 2012 12:53 AM

    Eric Hodel's Avatar

    Most likely your sudo environment is not identical to your non-sudo environment due to sudo environment scrubbing.

    Please compare gem env with sudo gem env and then consult your sudoers file to see which environment variables are not being allowed into the sudo environment. Likely GEM_HOME and GEM_PATH are not allowed.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac