问题
hope you can help me. i'm installing rvm with ruby, rails and the whole lot, and I've done it many times before, usually following this good tutorial http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
Everything seems to be fine, but I get this message when I try to run my bundle install (it's been working all afternoon actually):
ERROR: Gem bundler is not installed, run `gem install bundler` first.
If I then do as it says, I get:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /var/lib/gems
Any suggestion?
PS: I also noticed that when I install ruby, I get a message like:
No binary rubies available for: ubuntu/12.10/x86_64/ruby-1.9.3-p286.
PPS: the result of
which [gem|ruby|rails]
points to usr/bin/ruby. What I've noticed is that if i do
. ~/.bash_profile
then which gem points to my home and i can bundle install. If I reboot though, I have to do . ~/.bash_profile again...
回答1:
From the tutorial:
Under no circumstance should you install Ruby, Rubygems or any Ruby-related packages from apt-get. This system is out-dated and leads to major headaches. Avoid it for Ruby-related packages. We do Ruby, we know what's best. Trust us.
So the first thing, hunt down all the relevant packages (ruby, rubygems, even rvm) in Package Manager and make sure they are completely removed, then reattempt the tutorial again.
If you did everything right, which [gem|ruby|rails]
should all be pointing to files in your home folder and not anywhere else.
来源:https://stackoverflow.com/questions/13055062/rvm-and-bundle-install-in-ubuntu-12-10-errnoeacces