Cannot Load Such File -- Rack/Handler/Puma

cannot load such file -- rack/handler/puma

  1. Sandbox the gems so they don't get mixed up with those installed by Rubygems.

    Remove current bundler stuff with

    rm -rf .bundle Gemfile.lock bin vendor

    and then run

    bundle install --binstubs --path vendor

    This installs all gems into vendor/RUBY-ENGINE/VERSION/ and all executables into the bin dir. These are separate from the ones installed via the gem command, which will be system wide.

  2. Run using bundle exec, but since the --binstubs command was used you can instead run

    bin/rackup config.ru

By using bundle exec or one of the executables from bin/ you're telling Bundler to only use the gems that it installed. If you installed Puma with Bundler then it will install the Puma handler with the Rack that Bundler installed. But, you'll probably have another version of Rack installed by Rubygems (via gem install rack -r) that doesn't have the handler. To get the right one, sandbox your project's gems and always run stuff from the bin/ directory. If you need the ruby command then use bundle exec ruby… and Bundler will load the correct gems for the project.

I do this with every project now and only install gems via gem install… if I need them system wide. It also makes sure you don't miss any gems out of the Gemfile because you had them already available on your system - no nasty surprises on deployment!

Ruby on Rails: cannot load rack/handler/

After all that work, the solution was simple. I was typing:

rails server -p 80 - b 139.162.246.138

Instead of:

rails server -p 80 -b 139.162.246.138

Sinatra app - Shotgun don't work - cannot load such file -- rack/commonlogger (LoadError)

I ran across the same error and found by adding gem 'shotgun' to my project's Gemfile and bundling I was able to get past that error.

Rackup: cannot load such file 'sinatra'

my guess is that your rackup script is a binstub of a 'rack' gem
installed in a diff ruby1.9x vm

maybe earlier version of ruby1.9.2
so it can't see the sinatra installed

I'd try 'which rackup' on the command line

Rackup Fails. Require Sinatra Fails

You need to update the Sinatra gem to sinatra-2.0.7.

Run:

$ gem install sinatra -v 2.0.7


Related Topics



Leave a reply



Submit