LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 08-23-2009, 06:14 PM   #1
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Angry Installing Ruby on Rails -- "gem update --system is disabled on Debian".


I've found myself in a bit of a quandary while installing Ruby on Rails on my Lenny box.

Short version: When I try to install all of the ruby gems needed to run Ruby on Rails, I get to a point where ruby requires rubygems v. 1.3.1. According to ruby, the recommended method of upgrade is "gem update --system", however I get the following error when I try this:

Code:
ERROR:  While executing gem ... (RuntimeError)
    gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
As far as I can tell, the Debian repositories for Lenny don't have any versions of rubygems higher than 1.2.0.


Long Version
(i.e. How the @$# did you get yourself into this mess?)

I started by doing an apt-get install of rails and rubygems.

I had read that the Debian packaging standards don't play nice with the way that Ruby installs files, so I decided to install everything from that point using 'gem install' rather than apt-get.

A transcript of the steps that I took is here: rails_install_transcript.txt.

At this point, I ran into the error quoted above.

I backed out all of the gem installs that I had done so far, using "gem uninstall", and ran "apt-get install rails".

Then tried typing 'rails -v' and got something like this: (sorry, the exact error message has scrolled out of the terminal line buffer)

rails: /var/lib/gems/1.8/bin/rails no file or directory.

Code:
$ type rails
rails is hashed (/usr/bin/rails)
and /usr/bin/rails was trying to call /var/lib/gems/1.8/bin/rails.

Ok... no harm, no foul, now that I've done the proper apt-get install rails, presumably something has changed so that when I start resolving the cascade of dependencies, I won't need to upgrade rubygems... gem install rails, gem install test-spec, gem install camping, gem install fcgi, gem install memcache-client, gem install mongrel, gem install ruby-openid -v "~> 2.0.0" (#@$% versioning error), gem install thin...

Finally, rails -v gives me "Rails 2.3.3".

Code:
$ rails hello
      create  
      create  app/controllers
      create  app/helpers
      create  app/models
      create  app/views/layouts
      create  config/environments
      create  config/initializers
... chug chug chug

when all the directories are created,

Code:
$ cd hello

$ script/server
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update --system` and try again.

$ sudo gem update --system
ERROR:  While executing gem ... (RuntimeError)
    gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.


I think that I must have taken a wrong turn from the Debian way when I started installing everything as gems at the beginning, but I'm not clear as to how to rectify the situation. AFAIK, gem uninstall is a fairly clean uninstall; after I uninstalled all of the gems after the first go-around, I would have thought that "apt-get install rails" should have installed the necessary version of rubygems and all of the correct version of all of the gems that ruby requires, alas it is not so.

Any and all suggestions welcome.
 
Old 08-23-2009, 08:33 PM   #2
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Original Poster
Rep: Reputation: 47
Install rubygems from source

It seems that the answer is probably to install Rubygems from source. Look here for details: http://articles.slicehost.com/2009/4...-ruby-on-rails

Will post results after I've tried this.
 
1 members found this post helpful.
Old 08-23-2009, 09:17 PM   #3
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Original Poster
Rep: Reputation: 47
worked like a charm.

Installing rubygems from source was dead simple, and I've got a working rails install.
 
1 members found this post helpful.
  


Reply

Tags
gem, install, rails, ruby


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any issues installing Ruby Gems and Ruby on Rails in Slackware? Lufbery Slackware 8 02-09-2011 07:22 PM
Error while installing MySQL Ruby gem skie_knite007 Programming 5 07-12-2009 06:57 PM
LXer: "Ruby on Rails" comprehensively renovated LXer Syndicated Linux News 0 03-17-2009 03:10 PM
LXer: Installing Debian Etch From A Windows System With "Debian-Installer Loader" LXer Syndicated Linux News 0 09-28-2007 12:41 AM
LXer: RubyConf*MI, OSCON, and"Ruby for Rails" LXer Syndicated Linux News 0 08-01-2006 11:54 PM


All times are GMT -5. The time now is 05:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration