views:

601

answers:

1

I get this error when trying ruby script/console

"Rails requires RubyGems >= . Please install RubyGems and try again:"

I expect this has something to do with the $PATH, however, I don't know what to do?

I'm running ruby 1.8.6 and rails 2.3.2.

I'd appreciate any help, thanks!

+5  A: 

Well it really looks as though you either don't have Gems installed, or it's not in your $PATH as you suggested.

You've given very little information to your problem, and more would be helpful: - What happened before you received this message - Has ruby, or gems worked on this machine before?

etc.

Some potential things to try-

  1. Is gem installed? You could try 'which gem' but clearly we don't expect it to be in your path. However you can check /usr/bin/gem which is where it should be on OS X if you have it installed. I'm not positive where it resides on other systems. There is a good list of instructions about how to install gems on the gems guide (note that this was the first link for googling 'install ruby gems'
  2. Is gems in your $PATH? Once gems are installed, you should check your PATH $ echo $PATH and if the parent directory of gem is in there. If not you should update your path in whatever the login script for you shell is. On OS X that script defaults to ~/.profile. Google should make this task easy for you.

My guess, although you've not given us enough information to make this obvious is that you switched machines. When you downloaded your code from another machine, you downloaded to a machine or user account that doesn't have gems installed.

Good luck, this shouldn't be too hard.

Aftermathew
Thank you very much, I will will try to add more info next time, this was my first post!Solution: It was a case of adding /usr/bin to $path in ~/.profile.
kerpunk
+1 very thorough answer. nice response.
Demi