【问题标题】:Error while installing rails json gem - bundler cannot continue安装 rails json gem 时出错 - 捆绑器无法继续
【发布时间】:2015-06-10 06:37:13
【问题描述】:

我在 Windows 上安装 Rails 时遇到问题。它无法安装 json gem,错误信息如下。

      create  test/integration/.keep
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.keep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.keep
         run  bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...........
Using rake 10.4.2
Using i18n 0.7.0

Gem::InstallError: The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
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.

【问题讨论】:

  • 您不应该在第三方端上传。 Stackoverflow 提供了一种上传图片并将其附加到您的问题中的方法。

标签: ruby-on-rails ruby-on-rails-4 rubygems


【解决方案1】:

运行这个命令-

sudo apt-get install libgmp-dev

【讨论】:

  • "... windows" 上的导轨安装
【解决方案2】:

通过阅读错误屏幕截图,您的系统似乎缺少某些原生 C/C++ 扩展所需的必要构建工具。

您可以尝试安装 RubyInstaller Development Kit。该工具包有助于在您的 Windows 机器上使用 Ruby 的原生 C/C++ 扩展。

安装说明见here

安装后,运行gem update --system,然后重试。

希望这会有所帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-04-08
    • 2022-10-05
    • 1970-01-01
    • 2021-07-02
    • 2023-03-06
    • 1970-01-01
    • 2018-09-08
    • 1970-01-01
    相关资源
    最近更新 更多