# New to Rails & Engines - Need help with 1.2 branch

**URL:** <https://www.ruby-forum.com/t/new-to-rails-engines-need-help-with-1-2-branch/83625>\
**Category:** Engines Development\
**Created:** [January 27, 2007, 10:41pm UTC](https://www.ruby-forum.com/t/new-to-rails-engines-need-help-with-1-2-branch/83625 "2007-01-27T22:41:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [January 27, 2007, 10:41pm UTC](https://www.ruby-forum.com/t/new-to-rails-engines-need-help-with-1-2-branch/83625/1 "2007-01-27T22:41:35Z")

</div>

Hi, I’m currently working a school project using Rails to build a web  
application.  
After looking at various plugins, our team has decided to go with  
Engines to allow re-use of some components of our application.

Since Rails 1.2 has just been released, we figured we might as well  
start developing with the latest version. We had tried some small  
engines using Engines 1.1.4 following the tutorial on ALTERthought  
Blogs and there was no problem.

With Engines 1.2, however, I’m having a hard time creating a new  
engine. Would it be possible to post a small tutorial outlining the  
steps to creating a simple engine using the 1.2 branch?

Here’s how I proceeded:

1. Created a new Rails project with dummy model & scaffold.
2. Installed the Engines plugin through the command:  
ruby script/plugin install  
[http://svn.rails-engines.org/engines/branches/rb\_1.2/](http://svn.rails-engines.org/engines/branches/rb_1.2/)
3. Tried to build my engine using the engine generator:  
ruby script/generate engine MyEngine

This step gives me the following error message:

* * *

> ruby script/generate engine MyEngine  
> ./script/…/config/boot.rb:29:Warning: require\_gem is obsolete. Use gem  
> instead  
> .  
> D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active\_support/dependenci  
> es.rb:377:in `new_constants_in': You have a nil object when you didn't expect it ! (NoMethodError) You might have expected an instance of Array. The error occurred while evaluating nil.empty? from D:/ruby/lib/ruby/gems/1.8/g ems/activesupport-1.4.0/lib/active_support/dependencies.rb:203:in `load\_file’  
> from  
> D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active\_suppo  
> rt/dependencies.rb:95:in `require_or_load' from D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_suppo rt/dependencies.rb:249:in `load\_missing\_constant’  
> from  
> D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active\_suppo  
> rt/dependencies.rb:453:in `const_missing' from ./script/../config/../vendor/plugins/rb_1.2/lib/engines/rails_exten sions/rails_initializer.rb:23 from D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge  
> m\_original\_require’  
> from  
> D:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in `re quire' from D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_suppo rt/dependencies.rb:496:in `require’  
> … 21 levels…  
> from  
> D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active\_suppo  
> rt/dependencies.rb:496:in `require' from D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_suppo rt/dependencies.rb:343:in `new\_constants\_in’  
> from  
> D:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active\_suppo  
> rt/dependencies.rb:496:in `require’  
> from script/generate:3

* * *

It’s probably a very trivial mistake on my part, but I would really  
appreciate if someone could point me in the right direction. My  
apologies if this email is being posted in the wrong forum / mailing  
list.

Thanks.

Steve

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [January 28, 2007, 12:34am UTC](https://www.ruby-forum.com/t/new-to-rails-engines-need-help-with-1-2-branch/83625/2 "2007-01-28T00:34:51Z")

</div>

Hi Steve,

There are two things going on here

On 1/27/07, Steve [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1. Tried to build my engine using the engine generator:  
> ruby script/generate engine MyEngine

With the 1.2 release of the engines plugin, you no longer generate ‘an  
engine’, since there is no such thing anymore. Instead, create a  
plugin as normal, except with app/, db/migrate, and so on as required.

I’d recommend creating plugins by hand since there’s nothing much to  
them (init.rb and lib, basically, everything else is additional), but  
you could use the plugin generator if needs be.

I’m not sure where the source of actual exception is coming from,  
since the ‘engine’ generator doesn’t exist anymore - do you have an  
old copy of the plugin installed?

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [February 24, 2007, 3:34am UTC](https://www.ruby-forum.com/t/new-to-rails-engines-need-help-with-1-2-branch/83625/3 "2007-02-24T03:34:30Z")

</div>

> I’d recommend creating plugins by hand since there’s nothing much to  
> them (init.rb and lib, basically, everything else is additional), but  
> you could use the plugin generator if needs be.

Why can’t we have a generator anymore? It still seems like a good idea  
if just to show people what a good structure is anymore. If nothing it  
sets up the testing directory which the plugin generator doesn’t have  
at all.

The engine generator was one of the biggest draws for me.

_Goes and installs an old version just for the generator_

---

<div class="post-metadata">

**Author:** ![steve](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@steve](https://www.ruby-forum.com/u/steve)\
**Post date:** [February 24, 2007, 10:31am UTC](https://www.ruby-forum.com/t/new-to-rails-engines-need-help-with-1-2-branch/83625/4 "2007-02-24T10:31:58Z")

</div>

On 2/24/07, Chuck V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Why can’t we have a generator anymore? It still seems like a good idea  
> if just to show people what a good structure is anymore. If nothing it  
> sets up the testing directory which the plugin generator doesn’t have  
> at all.

While I like that rails (and the old generator) prompts you to test by  
producing a test directory, this can’t be the only thing that  
convinces you that you need to write some tests. More often than not,  
the test directory (and the others: public, db/migrate, etc) would  
just be ignored if they were unwanted.

This is why I dropped the generator - too often we’d end up with  
plugins that had a public/ directory tree that was completely empty,  
or a functional tests directory that just wasn’t relevant, but was  
hanging around regardless. This is one of the reasons that “engines”  
were perceived as heavyweight, and I doubt anyone can have avoided my  
“engines are dead, we’re all just lightweight plugins now”  
near-ranting.

I guess ultimately I feel that the generator helped _too much_, to the  
detriment of the project. I’m sorry that you are feeling its absence,  
but creating only the directories that _you_ need isn’t too bad is it?
