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:
- Created a new Rails project with dummy model & scaffold.
- Installed the Engines plugin through the command:
ruby script/plugin install
http://svn.rails-engines.org/engines/branches/rb_1.2/ - 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:innew_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:inrequire_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:inconst_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:inre 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:inrequire' 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