Forum: Rails Engines stack level too deep (SystemStackError)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ef0db53920b243d6758c2f6b1306df0d?d=identicon&s=25 Steve Ross (cwd)
on 2006-05-08 19:29
I picked up a post on the RoR list and decided to see if it fixed my
stack level problem. It did so IĆ¢??m x-posting. Here is the original post,
in case anyone else is having this problem:

For clarification, the problem only occurs in an environment where Gem
Rails is present. The current code handles this improperly. So, we have
a stop-gap fix and it appears the real fix is due RSN.

>>     #load this before doing ANYTHING freaky with the reloading.
>>     begin
>>       require 'rails_version' # Rails 1.0, 1.1.0
>>     rescue LoadError, Gem::Exception
>>       require 'rails/version' # renamed as of Rails 1.1.1
>>     end
>> As I am running Rails 1.1.2, in order to get the correct rails version
>> file being loaded I need the first "require" above to fail, so that the
>> rescue kicks in and the second "require" loads the "rails/version.rb"
>> from vendor/rails/....
>> Unfortunately, in my case (on Dreamhost) the first require does not fail
>> as the Rails 1.0 gem is available.
>> If I change the above code to simply say:
>>    require 'rails/version'
>> then my app works just fine.
This topic is locked and can not be replied to.