mutewinter / Showbot

🤖 An IRC Bot and Website for 5by5.tv written with the Cinch and Sinatra frameworks
MIT License
90 stars 31 forks source link

`initialize': wrong number of arguments(1 for 0) #30

Closed rikai closed 11 years ago

rikai commented 11 years ago

Hey there, i'm a bit of a ruby newbie, and i'm trying to get Showbot up and running to utilize it for my own purposes and to help teach myself a bit of ruby, but i seem to be hitting a bit of a roadblock.

I start it with foreman, but it ends up erroring out with what seems to be an error parsing the shows.json file, as far as i can tell.

The error log follows:

me@me:/home/me/testing/Showbot>foreman start -f Procfile.local
08:54:06 web.1  | started with pid 71230
08:54:06 irc.1  | started with pid 71231
08:54:08 irc.1  | /usr/local/lib/ruby/gems/1.9/gems/cinch-1.1.3/lib/cinch/rubyext/infinity.rb:1: warning: already initialized constant Infinity
08:54:08 web.1  | /usr/home/me/testing/Showbot/showbot_web.rb:19:in `initialize': wrong number of arguments(1 for 0) (ArgumentError)
08:54:08 web.1  |       from /usr/home/me/testing/Showbot/showbot_web.rb:19:in `new'
08:54:08 web.1  |       from /usr/home/me/testing/Showbot/showbot_web.rb:19:in `block in <class:ShowbotWeb>'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/sinatra-1.3.2/lib/sinatra/base.rb:1273:in `configure'
08:54:08 web.1  |       from /usr/home/me/testing/Showbot/showbot_web.rb:16:in `<class:ShowbotWeb>'
08:54:08 web.1  |       from /usr/home/me/testing/Showbot/showbot_web.rb:15:in `<top (required)>'
08:54:08 web.1  |       from /usr/home/me/testing/Showbot/config.ru:1:in `require'
08:54:08 web.1  |       from /usr/home/me/testing/Showbot/config.ru:1:in `block in <main>'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
08:54:08 web.1  |       from /usr/home/me/testing/Showbot/config.ru:1:in `new'
08:54:08 web.1  |       from /usr/home/me/testing/Showbot/config.ru:1:in `<main>'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `eval'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `load'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/thin-1.4.1/lib/rack/adapter/loader.rb:42:in `for'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/thin-1.4.1/lib/thin/controllers/controller.rb:169:in `load_adapter'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/thin-1.4.1/lib/thin/controllers/controller.rb:73:in `start'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
08:54:08 web.1  |       from /usr/local/lib/ruby/gems/1.9/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
08:54:08 web.1  |       from /usr/local/bin/thin:23:in `load'
08:54:08 web.1  |       from /usr/local/bin/thin:23:in `<main>'
08:54:08 web.1  | >> Using rack adapter
08:54:08 web.1  | exited with code 1
08:54:08 system | sending SIGTERM to all processes
SIGTERM received
08:54:08 irc.1  | * starting freenode_test
08:54:08 irc.1  | terminated by SIGTERM

Possibly relevant information: FreeBSD 8.2-release-p3 Ruby 1.9.3p125 (2012-02-16 revision 34643)

Any guidance you could provide would be wonderful. :)

mutewinter commented 11 years ago

Hmm, not sure why it would say wrong number of arguments. If you look at show.rb, it accepts the single argument of the JSON hash. Did you run bundle install before starting Showbot?

rikai commented 11 years ago

I did indeed. Here's the output when i run it again, in case versions are an issue for some reason:

Using i18n (0.6.0)
Using multi_json (1.0.4)
Using activesupport (3.2.6)
Using addressable (2.2.8)
Using awesome_print (1.0.2)
Using backports (2.6.1)
Using open4 (1.3.0)
Using thor (0.14.6)
Using backup (3.0.24)
Using bcrypt-ruby (3.0.1)
Using bond (0.4.2)
Using boson (1.1.1)
Using builder (3.0.0)
Using chronic (0.6.7)
Using numerizer (0.1.1)
Using chronic_duration (0.9.6)
Using cinch (1.1.3)
Using daemons (1.1.8)
Using json (1.6.7)
Using cinchize (0.3.0)
Using clipboard (1.0.1)
Using coderay (1.0.7)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using dm-core (1.2.0)
Using dm-aggregates (1.2.0)
Using dm-constraints (1.2.0)
Using dm-migrations (1.2.0)
Using fastercsv (1.5.5)
Using json_pure (1.6.7)
Using dm-serializer (1.2.1)
Using dm-timestamps (1.2.0)
Using dm-transactions (1.2.0)
Using stringex (1.3.3)
Using uuidtools (2.1.2)
Using dm-types (1.2.1)
Using dm-validations (1.2.0)
Using data_mapper (1.2.0)
Using data_objects (0.10.8)
Using dm-do-adapter (1.2.0)
Using dm-is-counter_cacheable (0.1.1)
Using do_mysql (0.10.8)
Using dm-mysql-adapter (1.2.0)
Using do_sqlite3 (0.10.8)
Using dm-sqlite-adapter (1.2.0)
Using drx (0.4.5)
Using eventmachine (0.12.10)
Using every_day_irb (1.2.2)
Using excon (0.14.3)
Using paint (0.8.5)
Using unicode-display_width (0.1.1)
Using fancy_irb (0.7.2)
Using multipart-post (1.1.5)
Using faraday (0.8.1)
Using formatador (0.2.3)
Using mime-types (1.19)
Using net-ssh (2.5.2)
Using net-scp (1.0.4)
Using nokogiri (1.5.5)
Using ruby-hmac (0.4.0)
Using fog (1.4.0)
Using foreman (0.51.0)
Using ruby_gntp (0.3.4)
Using g (1.6.0)
Using haml (3.1.6)
Using hirb (0.6.2)
Using spoon (0.0.1)
Using interactive_editor (0.0.10)
Using method_locator (0.0.4)
Using method_source (0.8)
Using methodfinder (1.2.5)
Using ori (0.1.0)
Using sketches (0.1.1)
Using wirb (0.4.2)
Using zucker (12.1)
Using irbtools (1.2.2)
Using looksee (1.0.3)
Using irbtools-more (1.2.0)
Using libv8 (3.3.10.4)
Using rack (1.4.1)
Using rack-protection (1.2.0)
Using rack-test (0.6.1)
Using rb-fsevent (0.9.1)
Using ri_cal (0.8.8)
Using sass (3.1.20)
Using simple_oauth (0.1.8)
Using tilt (1.3.3)
Using sinatra (1.3.2)
Using sinatra-contrib (1.3.1)
Using sinatra-reloader (1.0)
Using therubyracer (0.10.1)
Using thin (1.4.1)
Using twitter (2.2.0)
Using tzinfo (0.3.33)
Using whenever (0.7.3)
Using bundler (1.1.4)
mutewinter commented 11 years ago

The only difference I can think of that might cause this is that I'm using Ruby 1.9.2p290 instead of 1.9.3 like you. I'd get RVM and try it with 1.9.2.

rikai commented 11 years ago

That does indeed seem to be the issue. Guess something changes in later revisions that breaks things.