尝试使用shotgun命令时Shotgun ruby​​ gem错误

时间:2016-01-18 18:55:19

标签: ruby sinatra

我正在尝试使用霰弹枪运行一个简单的Sinatra应用程序,但每当我运行shotgun simple.rb时,我会在下面看到此错误。我无法在 localhost:9393 的浏览器中看到正在运行的应用程序。

murad@murad-Lenovo-Z50-70:~/Desktop$ shotgun simple.rb
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find shotgun (>= 0) amongst [actionmailer-4.2.4, actionpack-4.2.4, actionview-4.2.4, activejob-4.2.4, activemodel-4.2.4, activerecord-4.2.4, activesupport-4.2.4, arel-6.0.3, binding_of_caller-0.7.2, builder-3.2.2, bundler-1.10.6, bundler-unload-1.0.2, byebug-8.0.0, coffee-rails-4.1.0, coffee-script-2.4.1, coffee-script-source-1.9.1.1, debug_inspector-0.0.2, erubis-2.7.0, execjs-2.6.0, executable-hooks-1.3.2, gem-wrappers-1.2.7, globalid-0.3.6, i18n-0.7.0, jbuilder-2.3.2, jquery-rails-4.0.5, json-1.8.3, loofah-2.0.3, mail-2.6.3, mime-types-2.6.2, mini_portile-0.6.2, minitest-5.8.2, minitest-5.4.3, multi_json-1.11.2, nokogiri-1.6.6.2, power_assert-0.2.2, rack-1.6.4, rack-test-0.6.3, rails-4.2.4, rails-deprecated_sanitizer-1.0.3, rails-dom-testing-1.0.7, rails-html-sanitizer-1.0.2, railties-4.2.4, rubygems-bundler-1.4.4, rubygems-update-2.5.0, rubygems-update-2.0.3, rvm-1.11.3.9, sass-3.4.19, sass-rails-5.0.4, sdoc-0.4.1, spring-1.4.0, sprockets-3.4.0, sprockets-rails-2.3.3, sqlite3-1.3.11, test-unit-3.0.8, thor-0.19.1, thread_safe-0.3.5, tilt-2.0.1, turbolinks-2.5.3, tzinfo-1.2.2, uglifier-2.7.2, web-console-2.2.1] (Gem::LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /usr/local/bin/shotgun:22:in `<main>'

1 个答案:

答案 0 :(得分:0)

看起来你缺少一些依赖项。在运行shotgun命令之前,需要先安装gem。 来自Shotgun文档。

在命令提示符下运行:

  gem install shotgun

然后运行您的Sinatra应用程序:shotgun simple.rb