The Smashing Book
My copy of The Smashing Book has finally arrived. It took more that 10 days to mail from Germany to Hong Kong.

My copy of The Smashing Book has finally arrived. It took more that 10 days to mail from Germany to Hong Kong.

Red Hat have put out a public beta of the forth coming version of RHEL. The package list looks quite promising, with the improvement on virtualisation, storage and cluster suite improvements, you can easily tell that it’s target to the enterprise market and follows the trends.
For every new version of RHEL coming out, new software packages is added to the distribution, some old softwares get removed, and most of the software packages get updated version.
The most important changes are all system-config-* tools are gone now. The ext4 file system is the default, instead of ext3 in RHEL5. Python get updated from version 2.4 to 2.6 but Ruby is still in version 1.8.6, only a small minor update from version 1.8.5 in RHEL5. Since RHEL 6 only included in version 1.8.6, it will not even run Rails 3. Rails 3 required at least ruby 1.8.7, or ruby 1.9.2 to run, it’s a shame that Red Hat only include a old version of ruby in their RHEL6, but you can always install REE or compile from source by yourself.
Maybe you can give Ubuntu 10.04 LTS a try, Ubuntu 10.04 LTS also include some interesting feature including MySQL 5.1, python 2.6, Ubuntu Enterprise Cloud, and Ubuntu One File Syncing. Ubuntu 10.04 LTS is schedule to release on 29 April 2010.
Rails 3 beta 2 was released at April 1. From the blog post at Riding Rails, it seems that this beta 2 break lots of things.
Note that Ruby 1.8.7 p248 and p249 has marshaling bugs that crash both Rails 2.3.x and Rails 3.0.0. Ruby 1.9.1 outright segfaults on Rails 3.0.0, so if you want to use Rails 3 with 1.9.x, jump on 1.9.2 trunk for smooth sailing.
Both Ruby 1.8.7 p248 and p249 crashed and Ruby 1.9.1 have segfaults problem. So it’s time to move on to Ruby 1.9.2. Ruby 1.9.2 is still in the development phase but it will be ready in 4 months. The scheduled release date is 31 July 2010. Let’s install rvm with ruby 1.9.2 to try out the newly released Rails 3 beta 2.
Install rvm
$ mkdir -p ~/.rvm/src && cd ~/.rvm/src && rm -rf ./rvm/ && git clone git://github.com/wayneeseguin/rvm.git && cd rvm && ./install
The installation will take a while, and after rvm is installed, you’ll need to edit your .bashrc and .bash_profile. Append the following at the end of your .bashrc/.bash_profile:
if[[ -s /Users/stevew/.rvm/scripts/rvm ]];
then source /Users/stevew/.rvm/scripts/rvm;
fiInstall Ruby 1.9.2 head, remember to install the head of ruby 1.9.2 branch, not the preview1 because ruby 1.9.2 preview1 doesn’t work with tzinfo gem, you will have problem like this
.rvm/gems/ruby-1.9.2-preview1/gems/tzinfo-0.3.18/lib/ tzinfo/timezone.rb:108:in `rescue in get’: protected method `setup’ called for #<tzinfo::datatimezone:0x000000024b7cb8> (TZInfo::InvalidTimezoneIdentifier)
$ rvm install 1.9.2-head
It will take a while to download and compile the ruby 1.9.2. once completed you can run the ruby command to verify the ruby version.
$ rvm 1.9.2-head $ ruby -v ruby 1.9.2dev (2010-04-07 trunk 27247) [x86_64-darwin10.3.0]
Set the default ruby version to ruby 1.9.2-head
$ rvm 1.9.2-head --deafult
Install Rails3 beta2, you don’t need to use sudo here to install gem beacuse all gems will install in your local home directory
$ gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n $ gem install rails --pre
Install sqlite/mysql gems for rails
$ gem install sqlite3-ruby $ gem install mysql -- --with-mysql-dir=/usr/local/mysql
Just create a new project as usual and that’s it. you are now ready to try out Rails 3 beta 2.
Rails 3.0 beta was released 2 weeks ago, rails 3 has many improvement over previous version of rails. It’s also the first version that after rails and merb merged. Truth be told, rails 3 beta has changed a lot since version 2.3.5. Many gems has not supported in rails 3 beta yet, e.g. RSpec and Cucumber. It’s hard to move your existing project to Rails 3 without the support of required gem.
As a Rails programmer, you should already grab a copy of Rails 3 beta to learn the future development of Rails. I have already installed Rails 3 beta on my Mac. Rails 3 run smoothly on new project, except RSpec and Cucumber not supported. I was able to work on existing project on Rails 2.3.5 after installed Rails 3 beta, nothing weird has happened except when I want to start a new Rails 2.3.5 project.
MyMac:work stevew$ rails _2.3.5_ rails2project /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:777:in `report_activate_error': RubyGem version error: railties(3.0.0.beta not = 2.3.5) (Gem::LoadError) from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:211:in `activate' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1056:in `gem' from /usr/local/bin/rails3:18:in `'
What’s wrong with my rails 2.3.5? It turns out is the problem of railties gem installed by rails 3 beta, railties gem doesn’t exists before rails 3 beta, so it complain railties version 2.3.5 not found. I start google around, and I am not alone, there is a few people out there have the same problem, and I finally found the temporary solution in the web, but I forget the link. So here is the soltion:
edit your rails script, my rails is installed at /usr/local/bin/rails, change the last 2 line to
#gem 'railties', version #load Gem.bin_path('railties', 'rails', version) gemname = 'railties' gemname = 'rails' if version.split(".").first.to_i == 2 gem gemname, version load Gem.bin_path(gemname, 'rails', version)
Basically, we only replace the gem name of railties to rails if the version params start with 2.
Happy Chinese New Year and Happy Valentine’s Day. This year is the year of tiger. Good health for all of us.