Jarrod
Jarrod

Reputation: 2378

NoMethodError when deploying Sinatra Rack application with Passenger

I'm getting this error when I deploy my Sinatra app with Passenger and Apache:

Exception NoMethodError in application (undefined method `call' for nil:NilClass)

I can start the app with

ruby myapp.rb

or as a rack app with

ruby config.ru

and there are no problems. Any ideas why this only happens with Passenger?

Upvotes: 0

Views: 820

Answers (1)

elskwid
elskwid

Reputation: 21

A bit late to the party but I just had this happen for me. Turns out I needed to tell Sinatra not to "run" the app.

configure do
  set :run, false
  # ...
end

From the Sintara settings doc:

run - if enabled, Sinatra will handle starting the web server, do not enable if using rackup or other means.

Here is a list of the available settings for Sinatra

Good luck!

Upvotes: 1

Related Questions