【问题标题】:Shotgun ruby gem error when trying to use shotgun command尝试使用 shotgun 命令时出现 Shotgun ruby​​ gem 错误
【发布时间】:2016-04-24 01:18:55
【问题描述】:

我正在尝试使用shotgun 运行一个简单的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>'

【问题讨论】:

  • 请通过单击编辑器中的{ } 图标来格式化您的错误。您是否编辑了任何默认代码/配置?如果是这样,请将其包含在您的问题中。

标签: ruby sinatra


【解决方案1】:

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

在你的命令提示符下运行:

  gem install shotgun

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

【讨论】:

  • 我这样做了,但还是一样。使用 Cloud IDE 会不会更容易
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-19
  • 2012-03-19
  • 1970-01-01
  • 1970-01-01
  • 2021-04-22
相关资源
最近更新 更多