2016-09-03 53 views
0

當我開始我的末日,應用獵槍我看到LoadError:西納特拉應用程序 - 獵槍不工作 - 「無法加載這樣的文件 - 機架/ commonlogger(LoadError)」

E-MBP:test_app admin$ shotgun app.rb 
/Users/admin/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require': cannot load such file -- rack/commonlogger (LoadError) 
from /Users/admin/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require' 
from /Users/admin/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require' 
from /Users/admin/.rvm/gems/ruby-2.3.1/gems/shotgun-0.9.1/bin/shotgun:112:in `<top (required)>' 
from /Users/admin/.rvm/gems/ruby-2.3.1/bin/shotgun:23:in `load' 
from /Users/admin/.rvm/gems/ruby-2.3.1/bin/shotgun:23:in `<main>' 
from /Users/admin/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval' 
from /Users/admin/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>' 

有沒有錯誤!

「紅寶石app.rb」仍然有效,我看到我的主網頁瀏覽器:

E-MBP:test_app admin$ ruby app.rb 
== Sinatra (v1.4.7) has taken the stage on 4567 for development with backup from Thin 
Thin web server (v1.7.0 codename Dunder Mifflin) 
Maximum connections set to 1024 
Listening on localhost:4567, CTRL+C to stop 

我怎樣才能解決這個問題?


E-MBP:test_app admin$ ruby -v 
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] 
E-MBP:test_app admin$ rvm -v 
rvm 1.27.0 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/] 

西納特拉文件夾中只包含一個文件 - test_app/app.rb:

require 'sinatra' 

get '/' do 
    "Hello!" 
end 

寶石耙/獵槍/西納特拉是最新的:

E-MBP:test_app admin$ gem update rake 
Updating installed gems 
Nothing to update 
E-MBP:test_app admin$ gem update shotgun 
Updating installed gems 
Nothing to update 
E-MBP:test_app admin$ gem update sinatra 
Updating installed gems 
Nothing to update 

回答

1

我跑跨越了同樣的錯誤,並發現通過增加gem 'shotgun'到我的項目的Gemfile和捆綁我能得到過去,呃, ROR。

+0

它的作品!謝謝! –

相關問題