stackmob/stackmob-ruby — Issue #4: Heroku deployment errors
Author: randika
Created: 2011-11-07 23:11:54+00:00
State: open

Hi,
I'm working on a rails3.1 app to work with the stackmob REST API. Here is my app environment
development:
Ubuntu 11.04, Ruby 1.9.2, Rails 3.1
Production:
Heroku Cedar stack

### From the docs (accessed 07-Nov-2011)

Deploying your Heroku application only requires one additional step. After you have pushed your changes to Heroku you will need to run:

heroku run rake stackmob:deploy

Does this command still in use? Every time I ran this I get an error: (see below)

Running rake stackmob:deploy attached to terminal... up, run.4 Failed to register application. Unable to Communicate with stackmob.com or Authenticate. Please check your keys in config/stack mob.yml and try again

But everything works from rails console and rails web app on development mode.

After running above deploy command, the .herokuapp.com throw a new error. (see below)

Internal Server Error undefined method `each' for "Not Authorized\n":String

So the whole thing looks working well on production mode (heroku). So I did a trick (for now), I forked the gem and change this file.
lib/stackmob/rack/simple_oauth_provider.rb
```def auth_failed(env)
if pass_through?
authorized(env)
else
[401, {}, "Not Authorized\n"] # Replaced this line with authorized(env)
end
end
```
So now on heroku, the app works. What might be the issue here?