Comments
-
Greg Hurrell
Just playing with Ruby 1.9.2-p136 now via RVM to see if I can get the Rails app to boot and the spec suite to run and pass.
Some light reading:
- "Ruby 1.9 & Rails 3.0": http://www.metabates.com/2010/02/08/ruby-1-9-rails-3-0/
- "How to Make Your Rails 2.3 App Work with Ruby 1.9": http://scottiestech.info/2010/12/16/how-to-make-your-rails-2-3-app-work-with-ruby-1-9/
- "Transitioning a Rails app to Ruby 1.9.1": http://myblog.rsynnott.com/2010/03/transitioning-rails-app-to-ruby-191.html
Looks like our first show-stopper is going to be the linecache gem (last updated 12 June 2008); during running:
$ rvm use 1.9.2 $ gem install --pre rails # get 3.0.4.rc1 $ bundle install
We die at:
Installing linecache (0.43) with native extensions /Users/wincent/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /Users/wincent/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb Can't handle 1.9.x yet *** extconf.rb failed ***
linecache is getting pulled in by ruby-debug; excerpt from the
Gemfile.lock
:ruby-debug (0.10.4) columnize (>= 0.1) ruby-debug-base (~> 0.10.4.0) ruby-debug-base (0.10.4) linecache (>= 0.3)
According to this post there is a specific version of the ruby-debug gem for 1.9, called ruby-debug19, so updating my
Gemfile
to include:group :development do gem 'ruby-debug19' end
And that fixes the linecache thing.
-
Greg Hurrell
Next thing to explode is mongrel:
Installing mongrel (1.1.5) with native extensions /Users/wincent/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
Looks like 1.2.0.pre2 is needed. So,
Gemfile
update:gem 'mongrel', '>= 1.2.0.pre2', :require => nil
-
Greg Hurrell
With that,
bundle install
succeeds and the server (rails s
) boots.One warning to address:
app/helpers/tags_helper.rb:60: warning: else without rescue is useless
And requests die with:
TypeError (can't convert Pathname to String): app/mailers/exception_mailer.rb:25:in `escape' app/mailers/exception_mailer.rb:25:in `pretty_backtrace' app/mailers/exception_mailer.rb:12:in `exception_report' lib/exception_reporter.rb:67:in `report_exception' lib/exception_reporter.rb:12:in `rescue in call' lib/exception_reporter.rb:9:in `call' lib/cache_friendly_flash.rb:30:in `call'
I've seen this kind of Pathname-related failure before on other projects under 1.9.
-
Greg Hurrell
Ouch, after adding
.to_s
on somePathname
instances to avoid theTypeError
the Ruby interpreter itself crashes (first part of absolutely enormous debug dump):/Users/wincent/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.4.rc1/lib/active_support/dependencies.rb:239: [BUG] rb_gc_mark(): unknown data type 0x10(0x103b97750) non object ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0] ...
Probably gonna defer this little experiment for now then.
-
Greg Hurrell
Status changed:
- From: new
- To: open
-
Greg Hurrell
Note to self, to get back to 1.8.7 after this kind of experiment it is not enough to do
rvm use system
, because RVM wipes out theBUNDLE_PATH
environment variable.You need to restore the environment, probably easiest to do so by just starting another login session. Then
bundle install
to repopulate theBUNDLE_PATH
again. -
Greg Hurrell
It's official: Rails 4.0 will drop support for Ruby 1.8.x, so there's your deadline for moving.
When will 4.0 be here? Guessing probably about a year from now, either close to RailsConf 2012 or soon after it.
-
Greg Hurrell
Revisiting now. Things are looking promising.
Clicking around site under 1.9.2 I can't see any problems. Test suite runs and completes; still a number of failures to fix, but I don't see anything that looks like being a deal-breaker.
-
Greg Hurrell
Only 3 failures in the test suite (out of 4,408 examples). That's pretty exciting.
-
Greg Hurrell
Summary changed:
- From: Ruby 1.9.2 compatibility
- To: Update to Ruby 1.9.2
-
Greg Hurrell
Status changed:
- From: open
- To: closed
Add a comment
Comments are now closed for this issue.