没有这样的文件加载 - sinatra / session(LoadError)

时间:2014-03-11 12:11:08

标签: ruby rubygems centos sinatra

我无法运行ruby Web应用程序,并且收到此消息错误:

rackup webapp/config.ru --debug
nil
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- sinatra/base
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- sinatra/session
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:38 - no such file to load -- sinatra/session
Exception `LoadError' at /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/builder.rb:49 - no such file to load -- sinatra/session
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- sinatra/session (LoadError)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/local/deployer/webapp/config.ru:3
        from /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
        from /usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
        from /usr/local/deployer/webapp/config.ru:0:in `new'
        from /usr/local/deployer/webapp/config.ru:0

似乎无法找到sinatra的位置。 我的config.ru是:

require 'rubygems'
require 'sinatra/base'
require 'sinatra/session'
require './lib/miscsystem'
require './lib/deployer'

run Deployer
  • 我做了一个:gem install sinatra

这是#gem env

的输出
# gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /root/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://rubygems.org/"]
  - REMOTE SOURCES:
     - http://rubygems.org/

任何帮助?

1 个答案:

答案 0 :(得分:0)

问题解决了:

gem install sinatra-session