Rails 3.2 exception recommends rails_legacy_mapper, which isn't compatible with Rails 3.2 #5022

johndouthat opened this Issue Feb 12, 2012 · 4 comments


None yet
4 participants

johndouthat commented Feb 12, 2012

I'm upgrading an app from Rails 2.3 to 3.2 and I encountered this error message:

You are using the old router DSL which has been removed in Rails 3.1. Please check how to update your routes file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/ or add the rails_legacy_mapper gem to your Gemfile

The error message is defined here

However, that gem requires Rails 3.1 according to its gemspec

Someone forked the repo and updated the gemspec, but I installed that version and got the following error message instead:

/Users/john/.bundler/ruby/1.9.1/rails_legacy_mapper-1a2183189567/lib/rails_legacy_mapper/mapper.rb:78:in `connect': uninitialized constant Rack::Mount (NameError)
    from /Users/john/.bundler/ruby/1.9.1/rails_legacy_mapper-1a2183189567/lib/rails_legacy_mapper/mapper.rb:157:in `named_route'
    from /Users/john/.bundler/ruby/1.9.1/rails_legacy_mapper-1a2183189567/lib/rails_legacy_mapper/mapper.rb:170:in `method_missing'
    from /path_to_my_app/config/routes.rb:4:in `block in <top (required)>'

I'm going to stop being lazy, and update my routes.rb, but the error message should be updated for others' sake, so they don't try to use the incompatible gem.


johndouthat commented Feb 13, 2012

A workaround for the issue is to set the :require option for rack-mount)

gem 'rails_legacy_mapper', :git => 'git://github.com/tomwaddington/rails_legacy_mapper.git'
gem 'rack-mount', :require => 'rack/mount'

pixeltrix commented Feb 13, 2012

The rails_legacy_mapper was really only for people get an old app up and running quickly on 3.1 which removed support for the old DSL - it was not intended to be a long term option. Since Rails 3.2 has switched from Rack::Mount to Journey it was always likely to fail.

If someone can send me a pull request for adding 3.2 support I'll release a new version, however I'd recommend switching to the new DSL - it shouldn't take more than an hour even for the largest of routes.rb files


drogus commented Feb 18, 2012

I totally agree with @pixeltrix, can we close this?


rafaelfranca commented Feb 23, 2012

@drogus please close it. We removed the reference to rails_lagacy_mapper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment