NameError: uninitialized constant Rails::Application::Railties

Hi Guys

I am trying to run Spree on jRuby and Torquebox, but I get this error
when I try to start Spree with rails s:
NameError: uninitialized constant Rails::Application::Railties

This doesn’t happen under ruby 2.1.0. The problem is connected to
spree_auth_devise because if I comment it out from the Gemfile, then
Spree starts as expected with rails s.

I looked at Stackoverflow and found this solution:
Rails::Engine.class_eval do
def railties
@railties ||= self.class.const_get(:Railties).new
end
end

which seemed to work the author, but in this case it doesn’t help if I
add it to application.rb.

Anyone had the same problem?


Best Wishes,
Matt

I digged into this (NameError: uninitialized constant
Rails::Application::Railties) issue a bit more and it is caused by this
specific commit to spree_auth_devise:

I’ve also opened a github issue on spree_auth_devise here:

Jdutil, the author of the commit above was kind enough to answer, and he
told me that the issue is specifically related to this change:

But he doesn’t understand (and me neither) why it causes this error in
jRuby 1.7.11 (when it runs perfectly on ruby 2.1.0) when I try to start
rails with rails s:

NameError: uninitialized constant Rails::Application::Railties

Any ideas why this error happens on jRuby 1.7.11 and not on ruby 2.1.0?


Best Wishes,
Matt

Be 15 Mar 2014 -on 10:53:47, Mate K. ([email protected]) Írt:

Hi Guys

I am trying to run Spree on jRuby and Torquebox, but I get this error
when I try to start Spree with rails s:
NameError: uninitialized constant Rails::Application::Railties

This doesn’t happen under ruby 2.1.0. The problem is connected to
spree_auth_devise because if I comment it out from the Gemfile, then
Spree starts as expected with rails s.

I looked at Stackoverflow and found this solution:
Rails::Engine.class_eval do
def railties
@railties ||= self.class.const_get(:Railties).new
end
end

which seemed to work the author, but in this case it doesn’t help if I
add it to application.rb.

Anyone had the same problem?


Best Wishes,
Matt