ruby asin gem search failing on heroku - ruby-on-rails-3

I've recently moved over from the ruby-aaws gem to asin gem, which is a lot simpler to use and understand. However, I've encountered a really strange issue that's causing search failures for specific queries and only on heroku.
My code is the following:
require 'asin'
client = ASIN::Client.instance
client.search(:Keywords => "Shark Tale", :SearchIndex => :UnboxVideo, :ResponseGroup => :ItemAttributes)
When this runs on my local box, it works perfect without issue. However, when I run this on heroku, I see the following error logs:
REXML::ParseException: #<NoMethodError: undefined method `[]' for nil:NilClass>
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:340:in `pull_event'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:183:in `pull'
/app/vendor/bundle/ruby/2.0.0/gems/crack-0.4.0/lib/crack/xml.rb:203:in `parse'
/app/vendor/bundle/ruby/2.0.0/gems/crack-0.4.0/lib/crack/xml.rb:235:in `parse'
/app/vendor/bundle/ruby/2.0.0/gems/asin-1.1.2/lib/asin/client.rb:375:in `call'
/app/vendor/bundle/ruby/2.0.0/gems/asin-1.1.2/lib/asin/client.rb:197:in `search'
(irb):223:in `irb_binding'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/workspace.rb:86:in `eval'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/workspace.rb:86:in `evaluate'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/context.rb:380:in `evaluate'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:492:in `block (2 levels) in eval_input'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:624:in `signal_status'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:489:in `block in eval_input'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:247:in `block (2 levels) in each_top_level_statement'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:233:in `loop'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:233:in `block in each_top_level_statement'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:232:in `catch'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:232:in `each_top_level_statement'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:488:in `eval_input'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:397:in `block in start'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:396:in `catch'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:396:in `start'
/app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
/app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
/app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
...
Exception parsing
Line: 1
Position: 30315
Last 80 unconsumed characters:
Actor><Actor>Matthew Broderick</Actor><Actor>Patrick Warburton</Actor><Actor>J
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:439:in `rescue in pull_event'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:331:in `pull_event'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:183:in `pull'
from /app/vendor/bundle/ruby/2.0.0/gems/crack-0.4.0/lib/crack/xml.rb:203:in `parse'
from /app/vendor/bundle/ruby/2.0.0/gems/crack-0.4.0/lib/crack/xml.rb:235:in `parse'
from /app/vendor/bundle/ruby/2.0.0/gems/asin-1.1.2/lib/asin/client.rb:375:in `call'
from /app/vendor/bundle/ruby/2.0.0/gems/asin-1.1.2/lib/asin/client.rb:197:in `search'
from (irb):223
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
This fails around 9 out of 10 times on Heroku. I tried a few variations and some of the following variations succeed all the time:
Change the query slightly
client.search(:Keywords => "Shark Tales", :SearchIndex => :UnboxVideo, :ResponseGroup => :ItemAttributes)
Change the ResponseGroup
client.search(:Keywords => "Shark Tale", :SearchIndex => :UnboxVideo, :ResponseGroup => :Offers)
Does anyone know what's causing this?

Realized that the discrepancy between my local box and heroku is with ruby version.
I'm using 1.9.3 on local box whereas my heroku setting is 2.0.0
This is a solution for 2.0.0 from the author of the asin gem
http://asin.herokuapp.com/

Related

Rails 3: uninitialized constant IRB::ReadlineInputMethod::Readline (NameError) in Heroku

Ever since we updated to Rails 3.2.13 we've been unable to start the heroku rails console. The server is working just fine, but when we try to run the console, it gives the following error:
Loading production environment (Rails 3.2.13)
/app/vendor/bundle/ruby/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:212:in `const_missing_from_s3_library': uninitialized constant IRB::ReadlineInputMethod::Readline (NameError)
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/input-method.rb:113:in `gets'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb.rb:139:in `block (2 levels) in eval_input'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb.rb:138:in `block in eval_input'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:188:in `call'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:188:in `buf_input'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:103:in `getc'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/slex.rb:205:in `match_io'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/slex.rb:75:in `match'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:286:in `token'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:262:in `lex'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:233:in `block (2 levels) in each_top_level_statement'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb.rb:70:in `block in start'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb.rb:69:in `catch'
from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/irb.rb:69:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
What is going on? Thanks!
Just experienced this myself. As it turns out the rb-readline gem bumped a version that causes rails console, and other things to fail. Try locking it to '~> 0.4.2'.
gem 'rb-readline', '~> 0.4.2'

Heroku console giving Encoding::UndefinedConversionError

Running a heroku console with
heroku run console
all commands returning UTF-8 characters (like german Umlauts) will result in the following error:
irb(main):004:0> Play.all[-2]
Play Load (27.5ms) SELECT "plays".* FROM "plays" ORDER BY name asc
Encoding::UndefinedConversionError: U+00E4 from UTF-8 to US-ASCII
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `write'
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `printf'
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `output_value'
from /usr/local/lib/ruby/1.9.1/irb.rb:160:in `block (2 levels) in eval_input'
from /usr/local/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
from /usr/local/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from /usr/local/lib/ruby/1.9.1/irb.rb:70:in `block in start'
from /usr/local/lib/ruby/1.9.1/irb.rb:69:in `catch'
from /usr/local/lib/ruby/1.9.1/irb.rb:69:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'Maybe IRB bug!!
I do not really understand the cause of this.
Is there a workaround?
I am using iTerm with a setting of "UTF-8 xterm-color".
Update
This error completely disappeared for no reason known to me and I can reproduce it neither under ruby 1.9.2p320 nor 1.9.3p448
Typing "\u00E4" into the console now yields "ä" as expected:
irb(main):001:0> "\u00E4"
=> "ä"

Unable to run the rails generator for Draper

I'm on Ruby 1.9.3 and Rails 3.0.11. I recently installed Draper(0.12.0) gem, but I'm unable to run its generators. I get the following error when I try to run the generator on the Post model :-
rails generate decorator Post
/home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/whiny_nil.rb:48:in `method_missing': undefined method `config' for nil:NilClass (NoMethodError)
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/draper-0.12.0/lib/draper/railtie.rb:6:in `block in <class:Railtie>'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `call'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `each'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application.rb:147:in `block in load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application/railties.rb:11:in `each'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application/railties.rb:11:in `all'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application.rb:147:in `load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:319:in `load_generators_from_railties!'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:278:in `lookup'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:141:in `find_by_namespace'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:161:in `invoke'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/commands/generate.rb:10:in `<top (required)>'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:593:in `new_constants_in'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/commands.rb:17:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Any inputs, on how can I debug this would be really helpful.
Thank you.
The Problem is this section in v0.12.0 (the one you are using) https://github.com/drapergem/draper/blob/v0.12.0/lib/draper/railtie.rb#L5-L8
When I look at the master branch they changed to code to look like: https://github.com/drapergem/draper/blob/master/lib/draper/railtie.rb#L5-L10
You should upgrade your draper gem to the latest release and see if the error still occurs.

Rails 3.2 ActionMailer Demo Failing

I've been using rails 3 for quite a while, but I haven't had to use ActionMailer until now. I followed the guide and expected it to work out of the box. However, it appears that I've hit some error that lies deeply inside internal rails code. Unfortunately, I can't find any mention of this error, which I'm guessing must be do to configuration.
My mailer class is:
class UserMailer < ActionMailer::Base
default :from => "notifications#example.com"
def welcome_email
#url = "http://example.com/login"
mail(:to => "test#example.com", :subject => "Welcome to My Awesome Site")
end
end
When I try to use the mailer I get:
UserMailer.welcome_email
NoMethodError: undefined method `protected_instance_variables=' for ActionController::Base:Class
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/metal/compatibility.rb:22:in `block in <module:Compatibility>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/concern.rb:117:in `class_eval'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/concern.rb:117:in `append_features'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:232:in `include'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:232:in `<class:Base>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:171:in `<module:ActionController>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:3:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:11:in `<class:TestCase>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:10:in `<module:ActionView>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:8:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/prototype-rails-3.2.1/lib/prototype-rails/on_load_action_view.rb:17:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:234:in `block in load_dependency'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:234:in `load_dependency'
... 23 levels...
from /users/user/Documents/element/app/mailers/user_mailer.rb:1:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:469:in `load'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:469:in `block in load_file'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:468:in `load_file'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:353:in `require_or_load'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:192:in `block in const_missing'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `each'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `const_missing'
from (irb):1
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I'm using rails 3.2.1. I saw some mention of protected_instance_variables= being deprecated, which could maybe explain why it isn't defined for ActionController::Base. But, that seems like it would be a rails bug, and I would imagine that ActionMailer has been well tested. Anyone have any ideas?
Thanks
I had experienced a similar error on starting my rails 3.2.1 application--removing the prototype-rails gem solved it for me.
Of course I happen to be using prototype, so there is now a different problem to address.

Where do I put Sinatra files intended to be embedded in a Rails3 app?

I want to use the new Rails3 feature that allows you to embed a Sinatra app inside rails.
In my routes file, I have:
# app names changed to protect the (not so) innocent
MyApp::Application.routes.draw do
match "/service", :to => MyService
...
end
And in /lib/my_service.rb I have
class MyService < Sinatra::Base
get "/" do
"Hello World"
end
end
When I try to start the Rails server I get Uninitialized constant MyService (NameError), which I suspect means my Sinatra file is in the wrong directory. Where am I supposed to put it?
Full error text:
rails/my_app » rails server
=> Booting WEBrick
=> Rails 3.0.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/marshallyount/Projects/clients/method/rails/my_app/config/routes.rb:2:in `block in <top (required)>': uninitialized constant MyService (NameError)
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `draw'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config/routes.rb:1:in `<top (required)>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:127:in `block in reload_routes!'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:127:in `each'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:127:in `reload_routes!'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:120:in `block in routes_reloader'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `call'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/railtie.rb:14:in `block (2 levels) in <class:Railtie>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/activesupport-3.0.1/lib/active_support/callbacks.rb:419:in `_run_prepare_callbacks'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `new'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `build'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `block in build'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `each'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `inject'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `build'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:162:in `app'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config/environment.rb:5:in `<top (required)>'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config.ru:3:in `require'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config.ru:3:in `block in <main>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config.ru:1:in `new'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config.ru:1:in `<main>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/commands/server.rb:65:in `start'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/commands.rb:30:in `block in <top (required)>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/commands.rb:27:in `tap'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I found a good answer for this question, thanks to this article.
I was missing the all important requires header at the top of my routes file:
require 'my_service.rb'
# app names changed to protect the (not so) innocent
MyApp::Application.routes.draw do
match "/service", :to => MyService
...
end