DEV Community

fullstackplus
fullstackplus

Posted on

Running a modular Sinatra app on Heroku

Hello, I'm having trouble getting a modular Sinatra app to run correctly in production. The git push heroku master works fine, but when I try to submit a form through the /contact page I get:

bundler: failed to load command: rackup (/app/vendor/bundle/ruby/2.4.0/bin/rackup).

My Procfile:

web: bundle exec rackup config.ru -p $PORT
Enter fullscreen mode Exit fullscreen mode

My config.ru:

require 'rubygems'
require 'bundler'

Bundler.require

require_relative 'lib/app'
run Tir::App
Enter fullscreen mode Exit fullscreen mode

My lib/app.rb:

require 'sinatra/base'
require File.expand_path('articles', File.dirname(__FILE__))
require File.expand_path('static', File.dirname(__FILE__))
require File.expand_path('landing', File.dirname(__FILE__))

module Tir
  class App < Sinatra::Base
    #code
  end
end 
Enter fullscreen mode Exit fullscreen mode

I've tried all manner of tweaks but am stuck! Thanks for any help.

Top comments (1)

Collapse
 
fullstackplus profile image
fullstackplus

Hi Alex,

thanks for the reply. I'm assuming your example above is for a classic-style (not subclassed) Sinatra app? Mine is subclassed / modular, so I'm pretty much following the recipe outlined here: oreilly.com/library/view/sinatra-u...

I might give a classic-style version a try though, if only for debugging purposes. Cheers!