script/generate hoptoad is raising "wrong number of arguments (1 for 0)" on Rails 2.3.5
When attempting to upgrade a project from plugin to gem (yes, I
am late to the party), script/generate hoptoad is raising "wrong
number of arguments (1 for 0)". The hoptoad_notifier plugin,
exception_notifier plugin, and hoptoad initializer have been
removed. I have added config.gem 'hoptoad_notifier' to
my environment.rb. it looks like the error is occurring while
running rake hoptoad:test.
$ script/generate hoptoad --api-key <snipped>
exists lib/tasks
create lib/tasks/hoptoad_notifier_tasks.rake
insert
Dir[File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
$: << File.join(vendored_notifier, 'lib')
end
require 'hoptoad_notifier/capistrano'
appended to config/deploy.rb
create config/initializers/hoptoad.rb
rake rake hoptoad:test
(in /home/matt/develop/clients/nih/mpr.ror/trunk)
rake aborted!
wrong number of arguments (1 for 0)
(See full trace by running task with --trace)
rake hoptoad:test failed. Rolling back
rm config/initializers/hoptoad.rb
remove
Dir[File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
$: << File.join(vendored_notifier, 'lib')
end
require 'hoptoad_notifier/capistrano'
removed from config/deploy.rb
rm lib/tasks/hoptoad_notifier_tasks.rake
notempty lib/tasks
notempty lib
Loaded suite script/generate
Started
Finished in 0.000258 seconds.
0 tests, 0 assertions, 0 failures, 0 errors
System info:
Rails 2.3.5
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770,
Ruby Enterprise Edition 2010.01
$ls vendor/plugins/
2dc_jqgrid fixture_references footnotes headliner importer memory_test_fix nested_has_many_through shaw_lab_db_conventionalizer strip_attributes validation_reflection
Support Staff 2 Posted by joshua.clayton on 04 Mar, 2010 10:43 PM
Hi,
Could you add
--traceto the rake task like it suggests and paste that the full output?Thanks,
- Josh
3 Posted by shawlab on 05 Mar, 2010 03:07 AM
I added '--trace' inside the generator and ran it again.
This points to: `Logger.new(STDOUT)
From class Logger:
def initialize(logdev, shift_age = 0, shift_size = 1048576)Looks good to me.
Any ideas?
4 Posted by shawlab on 05 Mar, 2010 04:30 AM
While in debugger, I checked this:
Sure enough, no args. Any idea how I can identify the source file for Logger.new?
Support Staff 5 Posted by thoughtbot on 05 Mar, 2010 04:14 PM
Off the top of my head, since the Rails initializer will look for a logger.rb to provider a Logger class, you might try the following from script/console:
and investigate the files that show up?
6 Posted by cenize on 08 Mar, 2010 05:29 PM
I have the same problem. After run the script I have:
["C:/Software/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/action_mailer/vendor/text-format-0.6.3", "C:/Software/ruby/lib/ruby/gems/1.8/gems/actionmail er-2.1.0/lib/action_mailer/vendor/tmail-1.2.3", "C:/Software/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/vendor/html-scanner", "C:/Softwa
re/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/tzinfo-0.3.8", "C:/Software/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/act
ive_support/vendor/memcache-client-1.5.0", "C:/Software/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/xml-simple-1.0.11", "C:/Softwa
re/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib", "C:/Users/Juarez/Documents/Aptana Studio/unibem/test/mocks/development", "C:/Users/Juarez/Documents/Apt
ana Studio/unibem/app/controllers/", "C:/Users/Juarez/Documents/Aptana Studio/unibem/app", "C:/Users/Juarez/Documents/Aptana Studio/unibem/app/models", "C:/User
s/Juarez/Documents/Aptana Studio/unibem/app/controllers", "C:/Users/Juarez/Documents/Aptana Studio/unibem/app/helpers", "C:/Users/Juarez/Documents/Aptana Studio
/unibem/config", "C:/Users/Juarez/Documents/Aptana Studio/unibem/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/will_paginate-2.3.12/lib", "C:/Users/Juarez/Docu ments/Aptana Studio/unibem/vendor/plugins/restful_authentication/lib", "C:/Users/Juarez/Documents/Aptana Studio/unibem/vendor/plugins/ptbr_rails_plugin/lib", "C
:/Users/Juarez/Documents/Aptana Studio/unibem/vendor/plugins/hoptoad_notifier/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/hoptoad_notifier-2.2.0/lib", "C:/Us ers/Juarez/Documents/Aptana Studio/unibem/vendor", "C:/Software/ruby/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/../builtin/rails_info/", "C:/Software/ruby/lib/ruby/
gems/1.8/gems/rails-2.1.0/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/gemcutter-0.3.0/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin", "C:/Sof
tware/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.0/bin", "C:/Software/ruby/lib/ruby/gems/1.8/gems/a
ctiverecord-2.1.0/bin", "C:/Software/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.0/bin", "C:/So
ftware/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/bin", "C:/Software/ruby/lib/ruby/gems/1.8/
gems/actionmailer-2.1.0/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/activeresource-2.1.0/bin", "C:/Software/ruby/lib/ruby/gems/1.8/gems/activeresource-2.1.0/
lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/rails-2.1.0/bin", "C:/Software/ruby/lib/ruby/gems/1.8/gems/builder-2.1.2/bin", "C:/Software/ruby/lib/ruby/gems/1.
8/gems/builder-2.1.2/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/hpricot-0.8.2-x86-mswin32/bin", "C:/Software/ruby/lib/ruby/gems/1.8/gems/hpricot-0.8.2-x86-m
swin32/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/RedCloth-4.2.2-x86-mswin32-60/bin", "C:/Software/ruby/lib/ruby/gems/1.8/gems/RedCloth-4.2.2-x86-mswin32-60
/lib", "C:/Software/ruby/lib/ruby/gems/1.8/gems/RedCloth-4.2.2-x86-mswin32-60/ext", "C:/Software/ruby/lib/ruby/gems/1.8/gems/RedCloth-4.2.2-x86-mswin32-60/lib/c ase_sensitive_require", "C:/Software/ruby/lib/ruby/gems/1.8/gems/will_paginate-2.3.12/bin", "C:/Software/ruby/lib/ruby/gems/1.8/gems/hoptoad_notifier-2.2.0/bin"
, "C:/Software/ruby/lib/ruby/site_ruby/1.8", "C:/Software/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt", "C:/Software/ruby/lib/ruby/site_ruby", "C:/Software/ruby/lib /ruby/1.8", "C:/Software/ruby/lib/ruby/1.8/i386-mswin32", "."]
Support Staff 7 Posted by elindsay on 08 Mar, 2010 08:47 PM
Hey Cenize,
you mention that you're having a similar problem, but could you also walk us through the actions you performed to generate the same error, and what version of Rails, Rubygems, and hoptoad_notified that you are using?
If this ends up being a bug, it will help us narrow down the conditions under which it is being produced.
Thank you,
Emma
Support Staff 8 Posted by Matt Jankowski on 28 Apr, 2010 08:05 PM
shawlab,
Is this still an issue?