# Engines 2ish / Rails 2.0.1

**URL:** <https://www.ruby-forum.com/t/engines-2ish-rails-2-0-1/123113>\
**Category:** Engines Development\
**Created:** [December 14, 2007, 4:51am UTC](https://www.ruby-forum.com/t/engines-2ish-rails-2-0-1/123113 "2007-12-14T04:51:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dylan\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Dylan\_S](https://www.ruby-forum.com/u/Dylan_S)\
**Post date:** [December 14, 2007, 4:51am UTC](https://www.ruby-forum.com/t/engines-2ish-rails-2-0-1/123113/1 "2007-12-14T04:51:05Z")

</div>

This is on an app that successfully runs Engines 1.2, and Rails  
1.2.6… but ported to Engines 2.0.0-RC1, and Rails 2.0.1.

Added the engines boot.rb line to environment.rb after the existing  
boot require. The engines init.rb has not been changed, and sets:  
Rails.plugins[:project].code\_paths \<\< “app/interests” \<\< “app/  
apis” (which can be called via Engine.plugins now… but same  
exception is thrown).

init.rb:20:in `evaluate_init_rb': You have a nil object when you didn't expect it! (NoMethodError) The error occurred while evaluating nil.code_paths from ./ script/../config/../vendor/rails/railties/lib/rails/plugin.rb:79:in`evaluate\_init\_rb’  
from /projects/vendor/rails/activesupport/lib/active\_support/  
core\_ext/kernel/reporting.rb:11:in `silence_warnings' from ./script/../config/../vendor/rails/railties/lib/rails/ plugin.rb:75:in`evaluate\_init\_rb’  
from ./script/…/config/…/vendor/rails/railties/lib/rails/  
plugin.rb:39:in `load' from /projects/config/../vendor/plugins/engines/lib/engines/ plugin.rb:77:in`load’  
from ./script/…/config/…/vendor/rails/railties/lib/rails/  
plugin/loader.rb:33:in `load_plugins' from ./script/../config/../vendor/rails/railties/lib/rails/ plugin/loader.rb:32:in`each’  
from ./script/…/config/…/vendor/rails/railties/lib/rails/  
plugin/loader.rb:32:in `load_plugins' ... 30 levels... from /projects/vendor/rails/activesupport/lib/active_support/ dependencies.rb:496:in`require’  
from /projects/vendor/rails/railties/lib/commands/server.rb:39  
from script/server:3:in `require’  
from script/server:3

# No time to debug at the moment, as this isn’t a priority… but, just wanted to get this out there if this is a known issue, or anybody has any suggestions. Cheers !

Dylan

---

<div class="post-metadata">

**Author:** ![Dylan\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Dylan\_S](https://www.ruby-forum.com/u/Dylan_S)\
**Post date:** [December 14, 2007, 10:46am UTC](https://www.ruby-forum.com/t/engines-2ish-rails-2-0-1/123113/2 "2007-12-14T10:46:19Z")

</div>

Hi Dylan,

yes, I think you actually have to change your init.rb files.

Instead of:

> Rails.plugins[:project].code\_paths \<\< “app/interests” \<\< “app/  
> apis”

try:

code\_paths \<\< “app/interests” \<\< “app/apis”

This is because the Rails plugin loading mechanism has changed a lot.  
Contrary to Rails 1.2.x the init.rb file is now evalutated inside of  
the Plugin object. The Plugin object is then added to Engines.plugins  
after that. So it is not available in Engines.plugins in init.rb. The  
cool thing about this change is that you can access all the Plugin  
methods from within init.rb now.

Hmm, we probably should put that into some kind of upgrade note. Or  
even a rake task that goes through the init.rb files and removes those  
bits like Rails.Engines[:name]? But maybe that’s not worth the hassle?

Am 14.12.2007 um 04:50 schrieb Dylan S.:

> didn’t expect it! (NoMethodError)  
> plugin.rb:77:in `load' from script/server:3:in `require’  
> removed\_email\_address@domain.invalid  
> [http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org)

–  
sven fuchs removed\_email\_address@domain.invalid  
artweb design [http://www.artweb-design.de](http://www.artweb-design.de)  
grünberger 65 + 49 (0) 30 - 47 98 69 96 (phone)  
d-10245 berlin + 49 (0) 171 - 35 20 38 4 (mobile)

---

<div class="post-metadata">

**Author:** ![Dylan\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Dylan\_S](https://www.ruby-forum.com/u/Dylan_S)\
**Post date:** [December 21, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/engines-2ish-rails-2-0-1/123113/3 "2007-12-21T16:41:21Z")

</div>

I thoroughly enjoy automation, or at least a deprecation notice to let  
ya  
know. I’m just trying one of my projects on Rails 2 and Engines haven’t  
toyed with it much at all, but default install doesn’t work.

Is there an upgrade script we could manifest? I’m not sure of the exact  
updates yet, so I’ll be fishing for a bit.

---

<div class="post-metadata">

**Author:** ![Dylan\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Dylan\_S](https://www.ruby-forum.com/u/Dylan_S)\
**Post date:** [December 22, 2007, 10:36pm UTC](https://www.ruby-forum.com/t/engines-2ish-rails-2-0-1/123113/4 "2007-12-22T22:36:37Z")

</div>

On Dec 21, 2007 3:14 PM, Nathaniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I thoroughly enjoy automation, or at least a deprecation notice to let ya  
> know. I’m just trying one of my projects on Rails 2 and Engines haven’t  
> toyed with it much at all, but default install doesn’t work.

Hence the “ish” part of “2.0 ish”. Alas, some things just aren’t  
possible in Rails 2.0, but yes, they should certainly be documented.

I’d rather provide documentation than an upgrade script, and trust  
developers to figure out how things apply to their own code.
