【问题标题】:Could not find json-1.8.3 in any of the sources Run `bundle install` to install missing gems在任何源中都找不到 json-1.8.3 运行 `bundle install` 以安装缺少的 gem
【发布时间】:2016-03-15 16:08:04
【问题描述】:

我正在使用 Windows 8 进行开发。当我尝试使用 Rails 安装程序安装 Ruby 2.2.2 时,我的问题就开始了,这甚至让我试图克隆的源代码感到困惑。

我为 Ruby2.2.2 卸载了 RailsInstaller,而我的旧 Ruby2.0.0 开发控制台开始出现问题/错误。

这是我运行 bundle install 时的错误:

Gem files will remain installed in F:/Rails
Programs/RubymineProjects/Rails-Bootstrap
Template/vendor/bundle/gems/json-1.8.3 for inspection. Results logged
to F:/Rails Programs/RubymineProjects/Rails-Bootstrap
Template/vendor/bundle/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot
continue. Make sure that `gem install json -v '1.8.3'` succeeds before
bundling.

我也尝试按照指示安装JSON,但也失败了:

ERROR:  Could not find a valid gem 'json' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B:
certificate verify failed (https://rubygems.org/l atest_specs.4.8.gz)

我几乎尝试了所有与此相关的发现,但都无济于事。

我篡改的一些东西是 DevKit,我将其设置为 Ruby 2.2.2,但在卸载 Ruby 2.2.2 后我将其重新配置为 Ruby 2.0.0。

【问题讨论】:

  • 我也确实运行了 bundle exec rails s 我所拥有的只是:在任何源中都找不到 json-1.8.3 运行 bundle install 以安装缺少的 gem。
  • 您看到的 SSL 错误实际上是问题所在。你可以试试:stackoverflow.com/a/16134586/1753596
  • JSON is bundled with Ruby。你为什么要重新安装它?您“几乎尝试了所有方法”,但我们不知道这意味着什么。你需要给我们一个想法,这样我们就不会浪费时间在黑暗中拍摄建议你已经尝试过的事情。最后,在遵循网络上的指示时要小心。如果页面是旧的,甚至一年前,它可能有点过时了。两年前的页面更有可能是陈旧的,并且会给你错误的方向。 How to Ask
  • 当我运行我的 rails 服务器时,它给了我这个错误。我已经发布了我在尝试捆绑安装时收到的错误,这就是我必须按照说明重新安装 JSON 的原因。重装JSON也会提示SSL错误。
  • 如果输入require 'json',IRB 会发生什么?

标签: ruby-on-rails ruby json


【解决方案1】:

这是我为解决问题所采取的步骤。

  1. 我从 Gemfile.lock 中删除了所有 json 条目,然后
  2. 我确实跑了bundle install,然后
  3. 通过运行rails server启动服务器

它奏效了。谢谢。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多