views:

197

answers:

1

Hi Folks,

I am very confused by a sudden problem with running rake tasks:

softwareclick:/myapp/current# rake my_task --trace
(in /myapp/releases/20100621162444)
** Invoke my_task (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `text_area' for class `ActionView::Base'
/myapp/releases/20100621162444/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb:33:in `alias_method'
/myapp/releases/20100621162444/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb:33:in `alias_method_chain'
/myapp/releases/20100621162444/vendor/gems/lipsiadmin-5.1.2/lib/view/helpers/view_helper.rb:11:in `included'
/myapp/releases/20100621162444/vendor/gems/lipsiadmin-5.1.2/lib/lipsiadmin.rb:41:in `include'
/myapp/releases/20100621162444/vendor/gems/lipsiadmin-5.1.2/lib/lipsiadmin.rb:41
/myapp/releases/20100621162444/vendor/gems/lipsiadmin-5.1.2/lib/lipsiadmin.rb:40:in `class_eval'
/myapp/releases/20100621162444/vendor/gems/lipsiadmin-5.1.2/lib/lipsiadmin.rb:40
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/myapp/releases/20100621162444/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require'
/myapp/releases/20100621162444/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:208:in `load'
/myapp/releases/20100621162444/config/../vendor/rails/railties/lib/initializer.rb:307:in `load_gems'
/myapp/releases/20100621162444/config/../vendor/rails/railties/lib/initializer.rb:307:in `each'
/myapp/releases/20100621162444/config/../vendor/rails/railties/lib/initializer.rb:307:in `load_gems'
/myapp/releases/20100621162444/config/../vendor/rails/railties/lib/initializer.rb:164:in `process'
/myapp/releases/20100621162444/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
/myapp/releases/20100621162444/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
/myapp/releases/20100621162444/config/environment.rb:12
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/myapp/releases/20100621162444/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/myapp/releases/20100621162444/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/myapp/releases/20100621162444/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/myapp/releases/20100621162444/vendor/rails/railties/lib/tasks/misc.rake:4
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:238:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:238:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

I run a passenger/nginx app on debian with ruby 1.8.5 and the following gems installed:

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
ancestry (1.2.0)
chronic (0.2.3)
fastthread (1.0.7)
git (1.2.5)
haml (3.0.12)
hoe (2.6.1)
json (1.4.3)
json_pure (1.4.3)
lipsiadmin (5.1.2)
nokogiri (1.4.2)
passenger (2.2.14)
postgres (0.7.9.2008.01.28)
rack (1.2.1, 1.0.1, 1.0.0)
rails (2.3.8)
rake (0.8.7)
RedCloth (4.2.3)
rubyforge (2.0.4)
sitemap_generator (0.3.3)
texticle (1.0.2)
version (0.9.2)
whenever (0.4.2)

Due to the --trace I think it's something between lipsiadmin and active_support, but I simply can't figure out how to go forward.

Does anyone have an idea?

Thanks for your help,

Val

+1  A: 

What does the rake task look like? Are you including a dependency on :environment?

Do any other rake tasks work?

Remember that rake does NOT start up the rails stack unless your task has an :environment dependency.

Jason's rake overview

UPDATED: My further suggestion, in the comments, was the right answer:

Gems, and plugins, can have dependencies on each other that require specific load order. So the solution is to remove gems/plugins to find which one is causing the problem. Then add it back into the system and choose the load order explicitly.

Larry K
Hi, bad news, it's all the rake tasks ...This one starts like this: task :fetch_regnow => :environment do require 'rubygems' require 'nokogiri' require 'zlib' require 'open-uri' require 'active_record'The rest should just work. I haven't changed a thing in here.As far as I can see all these dependencies are met.I actually get the same result for "rake gems -list"
val_to_many
Maybe a gem is trying to call methods before all the libraries are loaded. I'd do some binary searching-first uninstall any newish gems that you suspect. Then add them back slowly to find the culprit.
Larry K
Hmmm I would say I am done checking that out ... so would that mean, that perhabs lipsiadmin calls for text_area before the ActionView::Base is loaded? If so or similar, do you know a way to prioritize those guys?
val_to_many
Hey Larry, not sure if you are reading this, but you were pointing me in the right direction. I had a bunch of gems loaded randomly before their dependencies were loaded. I removed them all and did a new deploy with rake gems:install to get them installed correctly. If you like you can post this as the answer and I will be happy to accept it. Thanks for helping!
val_to_many
Oh wait, I'll accept the one that's posted, sorry for being chaotic ;-)
val_to_many
Glad it worked out. I had the same problem with some plugins order a while back.
Larry K