... mostly about Ruby and Rails...

Freitag, 15. Juni 2007

Quickie: Installing Ruby and Rubygems on Debian Testing

So, I use Debian Lenny (Testing) for all my Ruby and Rails stuff, but I haven't found a good tutorial on how to get this running without stepping into some traps. So, here is my way:

- get a clean install of Debian
apt-get update
apt-get -y upgrade

- install Ruby
apt-get -y install ruby1.8 irb1.8 rdoc1.8 ri1.8 ruby1.8-dev
apt-get
-y install libzlib-ruby1.8 libopenssl-ruby1.8

- install Rubygems via apt-get
apt-get -y install rubygems

- the 'gem' command should work, now. (Note that the Rubygems .deb package is Version 0.9.4 !!!)
> gem env
RubyGems Environment:
  • VERSION: 0.9.4 (0.9.4)
  • INSTALLATION DIRECTORY: /var/lib/gems/1.8
  • GEM PATH:
  • - /var/lib/gems/1.8
  • REMOTE SOURCES:
  • - http://gems.rubyforge.org
- add the gems/bin dir to your $PATH by adding this to ~/.bashrc:
export PATH=$PATH:`gem env gemdir`/bin

that's all :-)


Notes:

'gem update --system' will not notice the different gems dir under Debian. So, all gems will disappear after that. Be aware!!!

Keine Kommentare: