简体   繁体   中英

Passenger-Sinatra: rack/showexceptions (LoadError)

I'm trying to learn how to deploy Ruby/Sinatra apps into the wild using Passenger and Nginx. Unfortunately when I try to run my code, I encounter the following error:

cannot load such file -- rack/showexceptions (LoadError)
/home/kwonda/.rvm/gems/ruby-2.5.1/gems/sinatra-base-1.0/lib/sinatra/showexceptions.rb:1:in `require'
/home/kwonda/.rvm/gems/ruby-2.5.1/gems/sinatra-base-1.0/lib/sinatra/showexceptions.rb:1:in `<top (required)>'
/home/kwonda/.rvm/gems/ruby-2.5.1/gems/sinatra-base-1.0/lib/sinatra/base.rb:6:in `require'
/home/kwonda/.rvm/gems/ruby-2.5.1/gems/sinatra-base-1.0/lib/sinatra/base.rb:6:in `<top (required)>'
/home/kwonda/.rvm/gems/ruby-2.5.1/gems/sinatra-base-1.0/lib/sinatra.rb:4:in `require'
/home/kwonda/.rvm/gems/ruby-2.5.1/gems/sinatra-base-1.0/lib/sinatra.rb:4:in `<top (required)>'
/home/kwonda/ITC/ITC.rb:1:in `require'
/home/kwonda/ITC/ITC.rb:1:in `<top (required)>'
config.ru:1:in `require'
config.ru:1:in `block in <main>'
/home/kwonda/.rvm/gems/ruby-2.5.1/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval'
/home/kwonda/.rvm/gems/ruby-2.5.1/gems/rack-2.0.5/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
/usr/share/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:380:in `run_block_and_record_step_progress'
/usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

I'm requiring the following gems:

require 'sinatra'
require 'sinatra/base'
require 'sinatra/reloader'
require 'docx'

Gemfile

source 'https://rubygems.org/'

gem 'sinatra'
gem 'sinatra-base'
gem 'sinatra-reloader'
gem 'docx'

# Use Passenger as app server:
# gem 'passenger'

I couldn't find any threads with a similar issue. My guess is that there's some sort of incompatibility with Rack and Sinatra, but all my gems have been updated. I'm running Centos 7 behind a corporate proxy. Any help would be great!

Skydan's question pointed me in the right direction. I was manually installing each gem instead of using:

$ bundle install

Afterwords my error logs finally started changing, but I was still using Sintara-Base 1.0. Once I updated with $bundle update my application finally loaded.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM