gem install not working?
Hi,
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.
i.e.:
$ sudo gem install ./pixcaptcha-1.0.gem
Password:
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 (0.0.3.3)
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?
Support Staff 2 Posted by Luis Lavena on 26 Jan, 2012 03:58 AM
Are you using rvm? Is "gem" between your user and sudo the same? What does
sudo gem list p result? What is your gemspec?
3 Posted by Sean on 01 Feb, 2012 08:38 PM
Hi,
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?
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.
Support Staff 4 Posted by Eric Hodel on 02 Feb, 2012 12:53 AM
Most likely your sudo environment is not identical to your non-sudo environment due to sudo environment scrubbing.
Please compare
gem envwithsudo gem envand 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.