ethyreal Mobile Developer

Rails installation errors...

Mar 24 2008 - By George Webster

When trying to install Ruby on Rails i was please by the excellent tutorials provided by hive logic. For the most part i found the rather lengthy install process for OS 10.4 Tiger easy to follow, however not everything went according to plan.

When i attempted to install rails from ruby gems i ran into this lovely error

ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find rails (> 0) in the repository

Needless to say this part was left out of the tutorial, and not one mention in the comments, so off to google i go searching for our answer.

Luckily i was not the first, and it appears that the gem cache has caused our lovely error and needs to be cleared..or erased.

Thanks to the army of robots i found this solution:

gem env
#which will give you something like this:
RubyGems Environment:
  - VERSION: 0.9.2 (0.9.2)
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  - GEM PATH:
     - /usr/lib/ruby/gems/1.8
  - REMOTE SOURCES:
     - http://gems.rubyforge.org

Grab the install directory, and then do the following:

rm -f /PATH/TO/GEM/PATH/FROM/ABOVE/source_cache

The do an update:

gem update --system #for gems 0.8.X or lower
gem update #for 0.9.0 or newer. This is not documented ANYWHERE.

Now for others this worked..but the Ruby Railroad was much like the early trans-continential expiditions and full of "fun".

So more googling, and i discover that their is another cach stored in:

~/.gem/source_cache

So i delete that as well, and still no love...mhmm

Back to google and down the in the comments of this blog i find a bit of gold:

%gem cleanup
%sudo gem update

Now finally the gem install rails works!!!

Everything else seems to install just fine, thanks again to hive logic for the instructions. Now creating my first application....wait rails 2.0 needs gems 0.8.4 and i have 1.8.2, how can this be, why would gems install a version of rails that it doesn't run with hmmm, its telling me to run "gem update-system" ...well the good thing about that is it kicks out the same error that started this issue, and after running the update and erasing the cache again, i'm back digging through google and i find this beautiful article here, which telling me i need to do the following instead:

If you have a recent version of RubyGems (0.8.5 or later), then all
you need to do is:

$ gem update --system (you might need to be admin/root)

(Note: You may have to run the command twice if you have any previosly
installed rubygems-update gems).

If you have an older version of RubyGems installed, then you can still
do it in two steps:

$ gem install rubygems-update (again, might need to be admin/root)
$ update_rubygems (... here too)

mhmm if only gems itself new this i would have avoided lots of googling.

in any event, i am now up and running ruby on rails locally on my mac with tiger 10.4 and only left with a minor headache. much love to the folks at the other end of all of my google searches.

Recent Posts

Categories

© 2012 ethyreal.com