The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
My Upgrade to Ruby 1.8.5

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Obie Fernandez

Posts: 608
Nickname: obie
Registered: Aug, 2005

Obie Fernandez is a Technologist for ThoughtWorks
My Upgrade to Ruby 1.8.5 Posted: Nov 26, 2006 9:53 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Obie Fernandez.
Original Post: My Upgrade to Ruby 1.8.5
Feed Title: Obie On Rails (Has It Been 9 Years Already?)
Feed URL: http://jroller.com/obie/feed/entries/rss
Feed Description: Obie Fernandez talks about life as a technologist, mostly as ramblings about software development and consulting. Nowadays it's pretty much all about Ruby and Ruby on Rails.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Obie Fernandez
Latest Posts From Obie On Rails (Has It Been 9 Years Already?)

Advertisement

I couldn't find any good (read: working) instructions for upgrading from Ruby 1.8.4 to 1.8.5 on Mac OSX (Version 10.4.8), so here is a rundown of what I did to upgrade my box. The steps are based on the Hivelogic Article and these other instructions.

First of all, download the Ruby tarball and run configure. For whatever reason, I didn't have wget already, so I installed it first.

$ sudo port install wget
$ wget "ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz"
$ tar zxvf ruby-1.8.5.tar.gz
$ cd ruby-1.8.5
$ ./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr/local

Now we have to make...

$ sudo make
$ sudo make test
$ sudo make install

...but unfortunately, make install failed for me with the following trace:

/Users/obie/ruby-1.8.5/lib/fileutils.rb:1239:in `copy': unknown file type: ./.ext/. (RuntimeError)
  from /Users/obie/ruby-1.8.5/lib/fileutils.rb:447:in `copy_entry'
  from /Users/obie/ruby-1.8.5/lib/fileutils.rb:1308:in `traverse'
  from /Users/obie/ruby-1.8.5/lib/fileutils.rb:445:in `copy_entry'
  from /Users/obie/ruby-1.8.5/lib/fileutils.rb:423:in `cp_r'
  from /Users/obie/ruby-1.8.5/lib/fileutils.rb:1379:in `fu_each_src_dest'
  from /Users/obie/ruby-1.8.5/lib/fileutils.rb:1393:in `fu_each_src_dest0'
  from /Users/obie/ruby-1.8.5/lib/fileutils.rb:1377:in `fu_each_src_dest'
  from /Users/obie/ruby-1.8.5/lib/fileutils.rb:422:in `cp_r'
  from ./ext/extmk.rb:389
make: *** [do-install-ext] Error 1

After some more (fruitless) googling, I decided to try making readline and copying the bundle file manually. It felt like a little bit of a shot in the dark. (For instance, my MacBook doesn't have a darwin8.7.1 directory as specified in the instructions I linked to above.)

$ cd ext/readline/
$ ruby extconf.rb 
$ make
$ sudo cp readline.bundle /usr/local/lib/ruby/1.8/i686-darwin8.8.1/

Now, back to the steps I was following before:

$ cd ../..
$ sudo make install
$ sudo make install-doc
$ make check

This time make install worked, albeit with lots of warnings, particularly about files that "differ in signedness". (Someone please tell me via comments if that's normal or not.) I backed out to my home directory and checked what/which version of Ruby I had now (for my sanity).

$ cd ..
$ ruby -v
ruby 1.8.5 (2006-08-25) [i686-darwin8.8.1]
$ which ruby
/opt/local/bin/ruby

Did it get installed into /opt/local because that's where I had it installed before? (Shrug) Well, whatever, now comes the moment of truth, or rather the first one. I switch to my current Rails project and fired up Mongrel and it fails because the RubyGems library is missing. Argh! Unsure what to do, I figured I'd install the latest gems distribution and see if that fixed things.

$ curl -O http://rubyforge.iasi.roedu.net/files/rubygems/rubygems-0.9.0.tgz
$ tar xzvf rubygems-0.9.0.tgz
$ cd rubygems-0.9.0
$ sudo /usr/local/bin/ruby setup.rb
$ cd ..
$ gem list

Interestingly, it found my old gems. Okay, time to try my Rails app again. Fire up Mongrel and it started up normally. Login to app, and the gruff graphs aren't working. WTF? I look at the logs and Rails is bitching about not being able to find RMagick, which I find strange, since it's listed as an installed gem. Okay, I figure, I'll cross my fingers and reinstall RMagick. (The crossing of the fingers was me hoping I wouldn't have to install the underlying ImageMagick again.)

$ wget http://rubyforge.org/projects/rmagick/
$ gem install rmagick
$ sudo gem install rmagick

After this everything seemed to be working again, with the exception of 500 errors caused by MySQL dropping the connection every few request. Not good!

Lost connection to MySQL server during query
... rails/activerecord/lib/active_record/vendor/mysql.rb:1127:in `write'

I wonder if I need to reinstall the MySQL native driver too. Ah yes, that's probably it.

sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql

I mash reload a few dozen times and the problem is gone. No more dropped connections. I'm guessing that any other gem that has native components is going to need to be reinstalled also. I hope these instructions help out other people trying to upgrade to 1.8.5.

Read: My Upgrade to Ruby 1.8.5

Topic: Ruby Reports exceeds 10000 downloads Previous Topic   Next Topic Topic: Conferencia Rails Hispana

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use