Skip to content

Session creation causes error with Rails engine generated under Rails 4.1 #14051

emclab opened this Issue Feb 13, 2014 · 2 comments

3 participants

emclab commented Feb 13, 2014

There are rails 4.1 and 3.2.12 installed on our system (windows). When generating rails engine with:

rails plugin new engine --T --mountable --dummy-path=spec/dummy

The engine is generated with Rails 4 by default. Under spec/dummy/config, we notice that it is:

Rails.application.configure do

Instead of in rails 3.2.12 engine:

Dummy::Application.configure do

It seems that the Dummy is replaced by Rails in rails 4 engine. Then we changed the gemspec to rails, '~> 3.2.11' and bundle install and replaced Rails.application with Dummy::Application in dummy/config (now it is rails 3.2.12 in gemfile.lock). However there is error when creating sessions under spec/dummy:

rake db:sessions:create

The error is undefined 'configure' or undefined 'migration_error=' even after replacing Rails.application with Dummy::Application. Is this a bug?. How to fix this problem? Thanks.

@emclab emclab closed this Feb 13, 2014
@emclab emclab reopened this Feb 13, 2014
Ruby on Rails member

Hello @emclab,

Actually I think that this is not really an issue. You can't simply change the Rails version in your gemspec to get the dummy application working with any version of Rails. I would advise you to add a Gemfile with gem 'rails', '~> 3.2.16' inside in the folder where you would love to store the engine and then run bundle exec rails new engine ....

I'm giving it a close but if I misunderstood your problem, let me know and I will reopen. Thank you!

@robin850 robin850 closed this Feb 16, 2014
Ruby on Rails member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.