The program 'gem' can be found in the following packages

I'm installing Ruby on Rails on Virtual Box/Ubuntu 13.10. Below are the steps

  1. ruby -v

    => The program 'ruby' can be found in the following packages ... Try: sudo apt-get install

  2. source /my account/...

    ==> Ok.

  3. \curl -L https://get.rvm.io | bash

    => I've got a message thanking me for using RVM. In case of problems, I should consult their website or twitter.

  4. rvm requirements

    ==> Requirments installation successful.

  5. type rvm | head -n 1

    ==> rvm is a function

  6. rvm list known

    ==> I get a list of ruby's versions

  7. rvm install 2.0.0 -C --enable-shared, --with-openssl-dir=/usr/local

    ==> Install of ruby 2.0.0 complete. Please consider upgrading to ruby 2.1.0 ...

  8. rvm list

    ==> rvm rubies =* ruby-2.0.0-p353 [i686 ]

    # => - current

    # =* - current && default

    # * - current

  9. rvm use 2.0.0@railstutorial_rails_4_0 --create --default

    ==> ok.

  10. rvm gemset list

    ==> gemsets for ruby-2.0.0-p353 ...

    (default)

    global

    => railstutorial_rails_4_0

  11. gem -v

    => The program 'gem' can be found in the following packages:

    • ruby1.9.1
    • rubygems try: sudo apt-get install

Why do I need to install ruby again? I thought I did so in step 7. I've gone over and over the same steps but I don't understand why it keeps telling me to install ruby again.

Thanks for helping

Answers


On your Terminal window go to Edit>Profile Preferences>Title and command, and check the box that says "Run command as a login shell". Restart your Terminal and try ruby -v and gem -v now. The versions should come up. If they don't then try re-installing them.


It sounds like the rvm ruby is not actually being used. If you run ruby -v, what do you get? I suspect it will be the message from the system about ruby being available in a package. Are you sure your $PATH is set correctly?

If you run /bin/bash --login and try again what happens?


check what rvm list returns.

I had multiple ruby versions installed but had not selected the ruby version to use.

I did rvm use <ruby_version> --default then ruby as well as gem command worked.


Need Your Help

Git Bash and Pageant are not using keys

windows git ssh putty

I've got Git for Windows (configured for MinTTY and PuTTY\plink.exe) and PuTTY installed, and I am trying to get it to work with a Bitbucket repository. I've got my SSH key loaded, in Pageant and o...

VS2008: Unable to start debugging, Remote Debugging Monitor has been closed

debugging visual-studio-2008 wow64

I am getting a mysterious error from time to time that I just don't get. I can "fix" it by restarting Visual Studio 2008, but that isn't exactly a solution...