linux
Install Ruby 1.9.2 and Rails 3 on Ubuntu 11.04
It seems apt-get hasn’t updated with ruby 1.9.2 and rails 3, so apt-get install ruby/rails won’t get ruby 1.9.2 and rails 3 (at least not for me at the moment).
But I really want to explore the world of rails 3, especially I’ve heard a lot has been changed since rails 2, which was the version last time I touched it while I was at CMU.
I was going to build from source but luckily I found this blog post which saved me quite a bit of time and effort.
However, I did encounter some problems by following the steps from that post, so I’m posting my steps here hopefully this could be useful to some else.
first you need to install bunch of packages via apt-get if you haven’t already:
1 | apt-get install curl git-core build-essential bison openssl libreadline5 libreadline5-dev zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev mysql-client mysql-server autoconf |
then you need install rvm, which is a great tool to manage your ruby version (I guess it’s like python_select in ruby world)
1 | curl -s https://rvm.beginrescueend.com/install/rvm |
add the following line to your .bashrc
1 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. |
source it so rvm is available in your shell session, I think the original post didn’t mention this step so if you follow it strictly like I did you will get an error like svmsudo command not found in further steps.
1 | source ~/.rvm/scripts/rvm |
then install ruby and rails
1 2 3 4 5 6 7 8 | rvm install 1.9.2 rvm use 1.9.2 --default rvm 1.9.2 --passenger rvm 1.9.2 gem install passenger apt-get install libcurl4-openssl-dev rvmsudo passenger-install-nginx-module gem install rails |
you should be able to use rails now:
shiqi@ubuntu:~$ which ruby /home/shiqi/.rvm/rubies/ruby-1.9.2-p180/bin/ruby shiqi@ubuntu:~$ ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] shiqi@ubuntu:~$ which rails /home/shiqi/.rvm/gems/ruby-1.9.2-p180/bin/rails shiqi@ubuntu:~$ rails -v Rails 3.0.8
easy, huh?
kudos to the author of the following references:
1. http://stuffingabout.blogspot.com/2011/04/installing-rails-3-on-ubuntu-1104.html
2. http://thekindofme.wordpress.com/2010/10/24/rails-3-on-ubuntu-10-10-with-rvm-passenger-and-nginx/
3. https://rvm.beginrescueend.com/rvm/install/
My new toy arrived
Dell XPS 8300 desktop to replace my old (yet still robust) Lenovo T60p laptop (for the past 2 years I’ve been using it as a desktop).
the newbie comes with i5 processor and 6G RAM, and I just put ubuntu 11.04 and fedora 15 on it, plus the existing Windows 7, it is really hard to decide which linux I should boot with ![]()
It will take me some time to install all the things I need, but nagios should be relatively easy, was trying to install that on my Macbook Pro with Macport, such a nightmare.
I spent 2 days trying to figure out the usage of gcc –arch flags and still have no clue how to fix that. decided to give up on that.
So far everything went pretty smooth, found this blog post to help with install rails 3 on ubuntu 11.04 but still having some minor troubles with rvm. Also the dual screen setting doesn’t look very easy to deal with in Ubuntu (my machine comes with only one HDMI plug and I had to use a Diamond BUV195 USB to DVI adapter to extend the screen). Fedora 15 meanwhile is giving me a hard time on the wireless adapter. I have to say under windows 7 those were handled much better (mostly because some of the drivers are only available for windows). All my wacky devices are recognized and installed, no question asked.
Looks I just found some gigs for the weekend to figure out, can’t wait! ![]()

| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Aug | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||
Archives
Tags
Recent Posts
Recent Comments
- LIBPF blog Testing UI with UI scripting: getting hooq to work | on making hooq work with pyQt and Qt4.7
- Mads Bondo Dydensborg on making hooq work with pyQt and Qt4.7
- Automatic Qt gui testing with Hooq – getting it to compile and work « Madsdyd's Weblog on making hooq work with pyQt and Qt4.7
- wangtian on A regular expression I just wrote today (and a wonderful tool I just digged)
- wangtian on A regular expression I just wrote today (and a wonderful tool I just digged)