Forum: JRuby NameError: uninitialized constant Rails::Application::Railties

4fdb09782e56e8aa7bd897c92fed450c?d=identicon&s=25 Mate Kaszas (Guest)
on 2014-03-15 10:55
(Received via mailing list)
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
4fdb09782e56e8aa7bd897c92fed450c?d=identicon&s=25 Mate Kaszas (Guest)
on 2014-03-17 03:39
(Received via mailing list)
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:
https://github.com/spree/spree_auth_devise/commit/...

I’ve also opened a github issue on spree_auth_devise here:
https://github.com/spree/spree_auth_devise/issues/169

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:
https://github.com/spree/spree_auth_devise/blob/ma...
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 Kaszas (mate@bevisible.hu) Í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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.