Get Mac OSX Snow Leopard edged for Ruby on Rails 3.0 – part 1
by Matt on Apr.17, 2010, under Ruby on Rails
First, why should you want to upgrade?
Ruby 1.9 is a new series of Ruby. It is modern, faster, with clearer syntax, multilingualized, a much improved version of Ruby.
- 1.8 has been used since 2003, I think it’s time for a new version
- Ruby 1.9 is is over 3 times faster than ruby 1.8.6 see it for yourself
- New methods
- Better syntax
- New classes
* read this great read up on ruby 1.9
Install ruby 1.9.1 fresh
(to upgrade skip this and see below)Download
[msimpson@dakota ~] $ mkdir src [msimpson@dakota src] $ cd src [msimpson@dakota src] $ curl -Ov ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p376.tar.gz [msimpson@dakota src] $ curl -Ov http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.3.6.tgz
Unpack, Make and Install Ruby
[msimpson@dakota src] $ tar -xzvf ruby-1.9.1-p376.tar.gz [msimpson@dakota src] $ cd ruby-1.9.1-p376 [msimpson@dakota src] $ autoconf [msimpson@dakota src] $ ./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1 && make && sudo make install [msimpson@dakota src] $ cd ..
Unpack and Install Rubygems
[msimpson@dakota src] $ tar xzvf rubygems-1.3.6.tgz [msimpson@dakota src] $ cd rubygems-1.3.6 [msimpson@dakota src] $ sudo /usr/local/bin/ruby setup.rb [msimpson@dakota src] $ cd ..
Or to upgrade
Download
I use the rvm gem, it freaking rocks! It manages the versions of ruby to use.
gem install rvm rvm-install
Follow the instructions at the end of the last command then close and open a new terminal.
Install ruby 1.9.1 and use it
[msimpson@dakota ~] $ rvm install ruby-1.9.1-p378 [msimpson@dakota ~] $ rvm use 1.9.1
Check to see that it is installed
[msimpson@dakota ~] $ ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.3.0]
*check out the website for rvm to see what kinds of ruby you can install (ie jruby, 1.9.2, etc.)
if all goes wrong down the road you can always switch to default
[msimpson@dakota ~] $ rvm use default
Play Around
Now that you have ruby 1.9 installed you can use some pretty rad new methods.
one of my favorites is Hash#each_with_index:
[msimpson@dakota ~] $ rvm use 1.9.1
[msimpson@dakota ~] $ irb
ruby-1.9.1-p378 > hash = {:name => 'matt', :verb => "loves", :noun => "ruby 1.9" }
=> {:name=>"matt", :verb=>"loves", :noun=>"ruby 1.9"}
ruby-1.9.1-p378 > hash.each_with_index{|value, index| print "index: #{index}, key: #{value[0]}, value: #{value[1]}\n" }
index: 0, key: name, value: matt
index: 1, key: verb, value: loves
index: 2, key: noun, value: ruby 1.9
=> {:name=>"matt", :verb=>"loves", :noun=>"ruby 1.9"}
18 Comments for this entry
3 Trackbacks / Pingbacks for this entry
-
Tweets that mention Get Mac OSX Snow Leopard edged for Ruby on Rails 3.0 – part 1 « Rails Grammer -- Topsy.com
April 17th, 2010 on 8:20 pm[...] This post was mentioned on Twitter by RoRrocket and RubyonRails Ireland, Ruby on Rails UK. Ruby on Rails UK said: Get Mac OSX Snow Leopard edged for Ruby on Rails 3.0 – part 1 … http://bit.ly/db7NEy [...]
-
Where can I download Web server Mail server ftp server MYSql serve Control panel the best web hosting together? | Host Rage
April 17th, 2010 on 9:06 pm[...] Gеt Mac OSX Snow Leopard edged fοr Ruby οח Rails 3.0 – раrt 1 &laq… [...]
-
Can you transfer your Mac stuff from leopard to the new snow leopard? | Apple On The Longtail
April 17th, 2010 on 10:19 pm[...] Get Mac OSX Snow Leopard edged for Ruby on Rails 3.0 – part 1 … [...]
November 29th, 2010 on 4:57 pm
one can argue that it can go both ways
December 8th, 2010 on 2:46 pm
The application needs to split the string into triplets, then split the triplet into numbers. In C, this would take up about 480K (20000 times 3 x 8 bytes) for the final array. The intermediate array of strings shouldn’t be much bigger than the long string itself (1MB). And I expect some overhead from PHP, say 300% to allow for indexes etc.
February 3rd, 2011 on 1:45 am
The catchy blog with the interesting contents. You give the nice information that many people don’t know before. most of your contents are make me have more knowledge. it is very different. I was impressed with your blog. Never be bored to visit your website again. Have the nice your time.Keep enjoyed your blogging.
February 3rd, 2011 on 1:52 am
Wow – this is the best article i’ve read in ages!
February 3rd, 2011 on 3:26 am
I have been checking out some of your posts and i must say pretty nice stuff.
February 3rd, 2011 on 5:29 am
Thanks for the amazing info. I find these posts have a lot of material. I can’t wait to get a minute to impliment all these great posts. Thank you very much.
February 3rd, 2011 on 7:21 am
wow. that was pretty awesome. they just keep getting better and better!
February 3rd, 2011 on 7:40 am
very refreshing of your writing. thank you and please write more about this
February 3rd, 2011 on 1:11 pm
very use full information. thank you.
February 3rd, 2011 on 7:21 pm
Love this blog. I’ll be bookmarking this one. Thanks!
February 4th, 2011 on 1:43 am
Very good
February 4th, 2011 on 5:19 am
-”~ oh that is a nice piece of information, kinda refreshing on my brain `~.
February 4th, 2011 on 5:46 am
This is a really nice blog you got here. The theme is great! Color combination is awesome.
February 4th, 2011 on 2:34 pm
What a great idea to let us in this whole procedure.
February 4th, 2011 on 3:52 pm
I enjoy you because of each of your hard work on this web page. My daughter takes pleasure in managing research and it’s easy to see why. I hear all regarding the compelling ways you convey valuable guidelines by means of your blog and even inspire participation from some other people about this idea so our favorite princess is without question becoming educated a whole lot. Have fun with the remaining portion of the year. You’re doing a really great job.
February 6th, 2011 on 10:57 am
I must have your layout tell me where you got it PLEEEAAAASSSEE!!
February 6th, 2011 on 4:11 pm
;,* that seems to be a great topic, i really love it ~.-
February 7th, 2011 on 3:38 am
so much excellent info on here, : D.