阅读更多
Rails on Ubuntu
1. Install ruby
>sudo apt-get install ruby-full
2. download and install rubygem
http://rubyforge.org/frs/?group_id=126&release_id=45995
>wget http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.8.4.tgz
>tar zxvf rubygems-1.8.4.tgz
>mv rubygems-1.8.4 ../tools/
>cd /home/luohua/tools/rubygems-1.8.4
>sudo ruby setup.rb
>sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
>sudo gem install rdoc
>sudo gem install rails
some problem here:
“File not found: lib” error
soluction:
>sudo mkdir /usr/lib/ruby/gems/1.8/gems/rails-3.0.7/lib # cannot work
>sudo gem install rails --pre # cannot work
>sudo gem install rails --pre --no-ri --no-rdoc # fine
3. MySQL
I have already install MYSQL server on my local machine.
So, I just install the drivers.
>sudo apt-get install libmysqlclient-dev libmysql-ruby
4. Install sqlite3 to create a sample
>sudo apt-get install libsqlite3-dev build-essential
>cd /home/luohua/work/rails
>rails new example
problem:
Installing rack (1.3.0) failure bundler raised an exception, are you offline?
solution: ignore right now
>cd example
>sudo bundle install
>sudo rake db:create
>sudo rails s
verify the URLs:
http://localhost:3000/
references:
http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/
http://cicolin.blogspot.com/2010/10/how-to-install-ruby-rails-and.html
http://lcqcxxc.iteye.com/blog/1030330
http://ranjith.zfs.in/how-to-install-ruby-on-rails-ror-in-ubuntu-linux/
http://excid3.com/blog/2010/10/ruby-on-rails-3-and-mysql-on-ubuntu-10-10/
http://grigio.org/how_install_rails_3_0_beta_ubuntu_linux_step_step