3

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...

akmur
  • 1,465
  • 2
  • 24
  • 37
  • `1.` Are you sure you have ruby installed? `2.` `sudo gem install`? – halfelf Oct 24 '12 at 18:05
  • If you are following the tutorial, you should end up with a local install. Why does it look like it you are having a root install? – prusswan Oct 24 '12 at 18:05
  • yes that's the whole point... i am sure, I've followed the tutorial many times before, i even erased a fresh 12.10 install because i thought i made a mistake... – akmur Oct 24 '12 at 18:08
  • Also i need to add that i managed to installa number of gems today, and I even had my local rails app running... – akmur Oct 24 '12 at 18:13
  • what does `which gem` return? – prusswan Oct 24 '12 at 18:13
  • Alex, does ruby work? Try `ruby -v` and `rvm` and tells us what this returns. Also, do not follow Ryan Bigg's tutorial. Go to the rvm website and follow what it says there. Note this from from the install page: Note that that any outside tutorials are NOT supported whether they work or not. Tutorials are great, however we have spent massive amounts of man hours debugging the installation process. Please use the install process(es) from this site only, as this is the only supported installation types and methods. – sunnyrjuneja Oct 24 '12 at 18:41
  • ruby -v ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux] and rvm is installed allright – akmur Oct 24 '12 at 18:45

1 Answers1

6

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.

prusswan
  • 6,853
  • 4
  • 40
  • 61
  • here is the instruction how to switch to proper RVM: http://stackoverflow.com/a/9056395/497756 – mpapis Oct 24 '12 at 18:29
  • 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... – akmur Oct 24 '12 at 18:38
  • @Alex if that's the case I would recommend that you move the rvm inclusion block to either `.bashrc` or `.profile`. You probably have one of those files already if `.bash_profile` is not automatically sourced on startup – prusswan Oct 24 '12 at 18:45
  • prusswan, appending the content of bash_profile to bashrc did the trick. I wonder if this is a misbehaviour with Ubuntu 12.10... never got this issue before! – akmur Oct 24 '12 at 18:56