04/02/2009: Installing Ruby and RubyGems On Ubuntu 8.10
Installing Ruby and RubyGems On Ubuntu 8.10
# ruby cd ~/rn wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.gz tar -xzvf ruby-1.9.1-p0.tar.gz cd ~/rn/ruby-1.9.1-p0 ./configure make make test sudo make install # zlib cd ~/rn/ruby-1.9.1-p0/ext/zlib sudo apt-get install zlib1g-dev ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib make sudo make install # gem cd ~/rn wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz tar -xzvf rubygems-1.3.1.tgz cd rubygems-1.3.1 sudo ruby setup.rb # fix ruby executable cd ~/rn/ruby-1.9.1-p0 sudo make install
03/14/2009: Using Rails Gem to Generate a New Project on Ubuntu
Using the rails installed by apt-get was a bit confusing because the rails project being generated was not the rails version that I expected. I had installed the rails gem v2.2.2 but the config/environment.rb file showed rails v2.1.
I fixed this issue by removing the default rails.
sudo apt-get remove rails
And then using an alias:
export GEMDIR=`gem environment gemdir` export RAILS_VERSION=`gem list rails | grep "rails " | cut -b8- | awk '{sub(/\)/, "");print}'` alias rails='ruby $GEMDIR/gems/rails-$RAILS_VERSION/bin/rails'
Now when I do
rails dool
The project uses the right version of rails!