scarably
scarably

Reputation: 333

Sinatra on Rails 5

I have problems adding sinatra as rack middleware for rails 5. The issue is that once I add gem "sinatra" to Rails Gemfile I cannot get the server running. But bundle install still finishes without errors. Could someone please explain to me how to add a (middleware) Sinatra App on Rails 5?

Upvotes: 1

Views: 389

Answers (1)

Steven B
Steven B

Reputation: 61

Rails will automatically require all gems in the gemfile, which is not ideal when using Sinatra as a middleware. This is documented on the Sinatra website here.

A workaround to this is changing your Gemfile to say gem "sinatra", :require => false then adding require "sinatra/base" to your app where it is needed.

Upvotes: 1

Related Questions