za3tar

Comments, Observations, and Brain Dumps from Ramallah (at heart).
  • rss
  • Home
  • About Me

Rails: GemNotFoundException

October 29, 2007 | 11:23 pm

For some reason, i could not find this information easily at one location, so i am dumping it here.

Running Ubuntu 7.10, i found myself re-installing ruby and rails on my system. Although prepackaged solutions containing both ruby and ruby on rails, i usually prefer to install ruby, and RubyGem, through my system’s package manager, and have gem freshly grab and install rails and all its dependencies.

So, here it goes:

  1. sudo -s … (this sends you to an admin mode so that you do not have to type sudo over and over again … do not abuse it and exit as soon as you are done)
  2. apt-get install ruby rubygem … should take care of installing ruby and rubygem on your system. (Debian system assumed, On SuSE Yast does that as well).
  3. gem install rails --include-dependencies … oh oh … Gem::GemNotFoundException … no rails !!!
  4. gem env … should show you your “GEM PATH” (in my case /var/lib/gems/1.8). In that directory, there is a source_cache file.
  5. rm /var/lib/gems/1.8/source_cache …. Delete that file!
  6. gem update … update your gem cache file
  7. gem install rails --include-dependencies … yaay it works
  8. exit … you must do this … do not abuse your root priviliges

This is it! The problem is that the stupid source_cache file is out of date and it needs to be resynchronized.

For some reason, after the successful installation i could not run the commands rails and rake directly from the console (without specifying the full path). This was because they were not added to /usr/bin. I didn’t bother googling for this because the solution is simple. If that happens with you, simply do the following:

  1. cd /usr/bin … this directory contains links to all your executable … do not mess with it … baby pandas will die if you do.
  2. sudo ln -s /var/lib/gems/1.8/bin/rails … this creates a symbolic link to rails … notice that the bin directory is in gem path specified by gem env.
  3. sudo ln -s /var/lib/gems/1.8/bin/rake … do the same for rake … it is useful.

This is it … i hope somebody finds it useful.

Categories
The Geek In Me
Comments rss
Comments rss

« Yazan’s Abstract Art A Busy Week »

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent Posts

  • Brain Dump / Core Dump
  • Wireless Electricity is Here
  • Middle East Nuclear Weapon Free Zone [video+commentary]
  • I am messing around with WordPress
  • Shot him, Yes; Killed him, No; The case of a journalist killed

Categories

  • Amman
  • Amused
  • Annoyed
  • Arabiana
  • Around the World
  • Art
  • Awesome
  • Blogonomy
  • Brain Dumps
  • Commercials
  • Cultural
  • Food
  • Funny
  • Interesting
  • Internet
  • Palestine
  • Picturesque
  • Questions
  • Ramallah
  • Stupidity
  • The Geek In Me
  • Uncategorized
  • Video
  • za3tarisms

Archives

  • September 2008 (1)
  • August 2008 (9)
  • July 2008 (6)
  • June 2008 (8)
  • May 2008 (14)
  • April 2008 (9)
  • March 2008 (13)
  • February 2008 (6)
  • January 2008 (9)
  • December 2007 (2)
  • November 2007 (15)
  • October 2007 (29)
  • September 2007 (10)

Cool Stuff


Firefox 3

openSUSE.org

openSUSE.org

Palestine Blogs

A Black Ribbon for the civilians of Gaza

Blog About Palestine Day

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox