Closed drnic closed 13 years ago
It looks like the ~/.gem folder is root:root instead of vagrant:vagrant. Thoughts on why this is?
Ruby on the lucid32 box is installed using the apt
package (as is standard for server installations on lucid). Rubygems is installed using the standard sudo ruby setup.rb
, so you actually have to sudo gem install
.
We're all spoiled by RVM and no more "sudo" but in server environments this is typically still required :)
Of course there are ways around it (such as installing RVM), but out of the box thats not how that lucid32 box is setup :) I'm going to close this, thanks.
I don't think ~/.gems should belong to any user than you. sudo gem install rails pits rails into a different gem repo; gem install rails goes into ~/.gems. I'm just not sure how it became owned by root.
It means that "bundle install" fails.
For anyone finding this, I had to manually ssh into the VM and run:
sudo chown vagrant:vagrant .gem
But not sure why it was root:root.
Oh sorry just noticed you said ~/.gems
instead of system gems. Hmm I'm really not sure how that is root. I'll look into it but thats pretty odd, and your workaround works for now.
Can I have sudo chown vagrant:vagrant .gem
run via my Vagrantfile or must I wrap it up in a custom chef recipe (or whatever provisioner is being used)? Ideas on this?
For now you must wrap it in a small custom chef recipe. Having simpler provisioners is something I plan on doing still.
Currently we can only use one provisioning system? A "simpler provisioner" would be a different provisioning system than chef-solo, or puppet; so would I only be able to use one or the other?
I can't figure out where in the chef recipes that ~/.gem is becoming set as root. That annoys me :)
Why was this issue closed? I'm having the same problem in 2017.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Any thoughts on this access issue?
My Vagrantfile (built on lucid32) using opscode chef recipes:
When I ssh in, I cannot install gems:
The only gems installed came via the
rails
chef recipe.Sorry if this is more of a recipe/environment issue; I thought it might be something odd with how the
vagrant
user is created. Or someone might have an idea what is going wrong here.