Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed Ruby using RVM.

I did a gem install rspec command and it seemed to install rspec correctly. If I do a rspec I get a "The program 'rspec' is not currently installed" and I am suggested to apt-get it.

If I try to do a gem install rspec again, it shows that rspec was already installed. I tried to do sudo gem install rspec thinking it might be permission problem but then the terminal said that the gem program wasn't installed.

How can I run the programs I have "gem installed" in Ubuntu without resorting to doing an "apt-get"?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

My problem was that the ruby version from my gem environment was different than from the ruby version from rvm.

I used the commands

gem env
which ruby

To diagnose the problem. This gave me the ruby version used by gem and rvm and then used

rvm use <ruby-version>

To match the two ruby versions.

I made a blog post with more details: Problems running the executable from a gem installed under rvm

share|improve this answer
add comment

When you use rbenv instead RVM you have option to run rbenv rehash, which will put gem binaries to path so you can use it. Also, you need to run rbenv rehash every time you install new gem that provides binaries.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.