My setup and the error
I get an error when I start my Sinatra application with rackup and puma. My config.ru
file looks like this:
#\ -s puma
require './controller/main.rb'
run Sinatra::Application
So when I now use rackup I get this error:
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.5.2/lib/rack/handler.rb:76:in `require': cannot load such file -- rack/handler/puma (LoadError)
I use ruby 1.9.3p392 (2013-02-22 revision 39386) [i686-linux]
What I have tried so far
My first thought was that I forgot to install puma, or puma is broken in some way. So I tried:
puma -v
puma version 2.0.1
And I start it directly with ruby:
ruby controller/main.rb
Puma 2.0.1 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://localhost:4567
And I found this puma issue but I didn't find a real solution.
Finally my questions
Why id this happening?
How can I fix this?
rm -rf .bundle Gemfile.lock bin vendor
and runbundle install --binstubs --path vendor
. Now all the exes are in the local bin dir and all the gems in the local vendor dir. 2) Run usingbundle exec
, but since thebinstubs
command was used you can instead runbin/rackup config.ru
. See if that improves things / brings back a different error. – Carchemish