≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Feature request #1681

Feature request #1681: Update to Ruby 1.9.2

Kind feature request
Product wincent.dev
When Created 2010-09-03T16:38:30Z, updated 2011-09-05T10:03:12Z
Status closed
Reporter Greg Hurrell
Tags no tags

Description

No plans on moving to 1.9.2 on my production server any time soon, but I would at least like to get the spec suite running and passing under 1.9.2 and keep it that way.

Comments

  1. Greg Hurrell 2011-02-01T23:49:53Z

    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.

  2. Greg Hurrell 2011-02-01T23:55:06Z

    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
  3. Greg Hurrell 2011-02-01T23:58:54Z

    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.

  4. Greg Hurrell 2011-02-02T00:11:40Z

    Ouch, after adding .to_s on some Pathname instances to avoid the TypeError 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.

  5. Greg Hurrell 2011-02-02T00:13:54Z

    Status changed:

    • From: new
    • To: open
  6. Greg Hurrell 2011-02-02T00:31:04Z

    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 the BUNDLE_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 the BUNDLE_PATH again.

  7. Greg Hurrell 2011-05-23T03:27:17Z

    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.

  8. Greg Hurrell 2011-09-05T00:55:57Z

    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.

  9. Greg Hurrell 2011-09-05T02:43:59Z

    Only 3 failures in the test suite (out of 4,408 examples). That's pretty exciting.

  10. Greg Hurrell 2011-09-05T02:45:03Z

    Summary changed:

    • From: Ruby 1.9.2 compatibility
    • To: Update to Ruby 1.9.2
  11. Greg Hurrell 2011-09-05T10:03:12Z

    Status changed:

    • From: open
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets