【问题标题】:Ruby Could not find mime-types-data-3.2016.0221 in any of the sources (Bundler::GemNotFound)Ruby 在任何源中都找不到 mime-types-data-3.2016.0221 (Bundler::GemNotFound)
【发布时间】:2016-07-13 17:06:04
【问题描述】:

我正在尝试启动并运行 Ruby,但一直遇到这个问题。 操作系统:Debian 6 Wheezy 红宝石:2.2.1 导轨:4.2.6

创建一个新项目: Rails 新示例1

获取著名的“我们很抱歉页面”, 错误页面: 在任何来源中都找不到 mime-types-data-3.2016.0221 (Bundler::GemNotFound) /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/spec_set.rb:94:in block in materialize' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:inmap!' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in materialize' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/definition.rb:137:inspecs' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in specs_for' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/definition.rb:171:inrequested_specs' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in requested_specs' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:insetup' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler.rb:92:in setup' /var/lib/gems/1.9.1/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in' /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require' /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:430:in activate_gem' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:297:inblock in run_load_path_setup_code' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:435:in running_bundler' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:296:inrun_load_path_setup_code' /usr/share/passenger/helper-scripts/rack-preloader.rb:100:in preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in' /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in <module:PhusionPassenger>' /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in'

我整天都在努力让这一切顺利进行。我不知道 Ruby 只是为了启动和运行而变得如此艰难。

【问题讨论】:

    标签: ruby bundler phusion


    【解决方案1】:

    我自己也遇到了这个问题。 As have others.

    您可以尝试直接安装 gem:

    gem install mime-types-data -v '3.2016.0221'
    

    然后再次尝试运行 Phusion Passenger。如果另一个 gem 出现类似错误,则可能意味着 gem 安装在 Phusion Passenger 使用的不同位置。

    例如,您可能还需要安装更新版本的mime-types

    gem install mime-types -v '3.0'
    

    我对 Phusion Passenger 没有太多经验。它可以与RVM 一起使用吗?如果可能的话,使用 RVM 可能是值得的。

    【讨论】:

    • 遇到同样的错误,使用最新版本手动安装 mime-types-datamime-types 解决了这个问题。但是,我必须先运行bundle clean --force
    【解决方案2】:

    尝试运行bundle install 以确保安装了所有依赖项。

    我在本地运行 dockerized ruby​​ 应用程序时遇到了类似的错误 - 在将新 gem 添加到 Gemfile 后,我忘记重新构建应用程序。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-18
      • 2018-04-08
      • 2012-04-19
      • 2015-03-04
      • 2014-07-11
      • 2012-06-08
      • 2019-11-16
      • 2014-06-05
      相关资源
      最近更新 更多