Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running 'rails g' after updating spree to the latest version from master #848

Closed
htapal opened this issue Dec 6, 2011 · 8 comments

Comments

@htapal
Copy link

htapal commented Dec 6, 2011

I'm running ruby-1.9.3-head with rvm using the latest version of rails (3.1.3). I had originally added just 'gem spree' to my Gemfile to play with spree.

I then wanted to try out the spree_related_products extensions, the latest version for which has a dependency on spree-core 1.0.0.beta so I updated the Gemfile to 'gem spree, :git => 'git://github.com/spree/spree.git'

Once the bundle updated, running 'rails g' throws the following exception:

/Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/activesupport-3.1.3/lib/active_support/inflector/methods.rb:124:in block in constantize': uninitialized constant RedirectLegacyProductUrl (NameError) from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/activesupport-3.1.3/lib/active_support/inflector/methods.rb:123:ineach'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/activesupport-3.1.3/lib/active_support/inflector/methods.rb:123:in constantize' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:24:inklass'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:43:in build' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:112:inblock in build'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:112:in each' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:112:ininject'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/actionpack-3.1.3/lib/action_dispatch/middleware/stack.rb:112:in build' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/engine.rb:447:inapp'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/application/finisher.rb:37:in block in <module:Finisher>' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/initializable.rb:30:ininstance_exec'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/initializable.rb:30:in run' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/initializable.rb:55:inblock in run_initializers'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/initializable.rb:54:in each' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/initializable.rb:54:inrun_initializers'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/application.rb:96:in initialize!' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:inmethod_missing'
from /Users/htapal/Projects/misc/awardexpress/config/environment.rb:5:in <top (required)>' from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/application.rb:83:inrequire_environment!'
from /Users/htapal/.rvm/gems/ruby-1.9.3-head@awardexpress/gems/railties-3.1.3/lib/rails/commands.rb:22:in <top (required)>' from script/rails:6:inrequire'
from script/rails:6:in `

'

@radar
Copy link
Contributor

radar commented Dec 6, 2011

This error would happen if you generated the application initially using:

 rails g spree:site

This inserts lines beginning with config.middleware into config/application.rb that aren't compatible with the edge version of Spree.

To fix this, remove these two lines and try again.

@radar radar closed this as completed Dec 6, 2011
@htapal
Copy link
Author

htapal commented Dec 6, 2011

That did it! Thanks.

@jesus-sayar
Copy link
Contributor

Very fine, thanks!!

@alanmaciel
Copy link

cool

@abepetrillo
Copy link

Helped me as well, thanks

@vivekraj2007
Copy link

Hello Iam getting following error, I did not see any above lines in application.rb

elm-khan-store/app/helpers/spree/admin/users_helper_decorator.rb:1:in `<top (required)>': uninitialized constant Spree::Admin::UsersHelper (NameError)

Thanks

@radar
Copy link
Contributor

radar commented Feb 1, 2013

@ratnamraju: Please open a new issue and provide the info stated in the Contributing Guidelines for this new issue. Thank you.

@vivekraj2007
Copy link

Hi @radar thanks for your reply here, and actual thing is now I would like to upgrade the spree from 1.1.1 to 1.3.1 but I am getting above errors.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants