I have tried everything I can think of to make this work for 3 days.
Thanks in advance.
Here is what I did:
rails 1.2.5 little_ones_bend
svn export
http://svn.subimage.com/source/substruct/site/trunk/vendor/plugins
vendor/plugins --username substruct --password substruct
svn export http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-5 vendor/
rails
followed instructions from
http://dev.subimage.com/projects/substruct/wiki/InstallingSubstruct
ruby script/generate plugin_migration
rake db:migrate
As near as I can tell, the engine plugin is sending a Hash to the
function named “redefine_task”
which calls “resolve_args” and dies because Hash has no .last method
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1653:in
`resolve_args’
here it is. error on line 1653
def resolve_args(args)
task_name = args.shift
arg_names = args #.map { |a| a.to_sym }
needs = []
if task_name.is_a?(Hash)
hash = task_name
task_name = hash.keys[0]
needs = hash[task_name]
end
if arg_names.last.is_a?(Hash) # line 1653 error here
hash = arg_names.pop
needs = hash[:needs]
fail “Unrecognized keys in task hash: #{hash.keys.inspect}” if
hash.size > 1
end
needs = [needs] unless needs.respond_to?(:to_ary)
[task_name, arg_names, needs]
end
Here is the engine code that is calling redefine_task
Rake::Task.redefine_task(plugin => :environment) do
plugin_base = RAILS_ROOT + “/vendor/plugins/#{plugin}”
options = []
files = Rake::FileList.new
options << “-o doc/plugins/#{plugin}”
options << “–title ‘#{plugin.titlecase} Plugin
Documentation’”
options << ‘–line-numbers’ << ‘–inline-source’
options << ‘-T html’
C:\rails_projects\little_ones_bend>rake db:migrate --trace
(in C:/rails_projects/little_ones_bend)
rake aborted!
undefined method last' for {}:Hash C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1653:in
resolve_args’
C:/rails_projects/little_ones_bend/config/…/vendor/plugins/engines/
tasks/engine
s.rake:9:in redefine_task' C:/rails_projects/little_ones_bend/config/../vendor/plugins/engines/ tasks/engine s.rake:24:in
redefine_task’
C:/rails_projects/little_ones_bend/config/…/vendor/plugins/engines/
tasks/engine
s.rake:63
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in each' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in
send’
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in each' C:/rails_projects/little_ones_bend/config/../vendor/plugins/engines/ tasks/engine s.rake:61 C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1737:in
in_namespace’
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:821:in
namespace' C:/rails_projects/little_ones_bend/config/../vendor/plugins/engines/ tasks/engine s.rake:58 C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1737:in
in_namespace’
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:821:in
namespace' C:/rails_projects/little_ones_bend/config/../vendor/plugins/engines/ tasks/engine s.rake:54 C:/rails_projects/little_ones_bend/vendor/rails/railties/lib/tasks/ rails.rb:8:in
load’
C:/rails_projects/little_ones_bend/vendor/rails/railties/lib/tasks/
rails.rb:8
C:/rails_projects/little_ones_bend/vendor/rails/railties/lib/tasks/
rails.rb:8:in
each' C:/rails_projects/little_ones_bend/vendor/rails/railties/lib/tasks/ rails.rb:8 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_re
quire’
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require' C:/rails_projects/little_ones_bend/rakefile:10 C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:2149:in
load’
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:2149:in
raw_load_rakefile ' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1897:in
load_rakefile’
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
standard_exceptio n_handling' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1896:in
load_rakefile’
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1880:in run' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
standard_exceptio
n_handling’
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in run' C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31 C:/ruby/bin/rake:19:in
load’
C:/ruby/bin/rake:19