安装rails json gem时出错 - bundler无法继续

San*_*eri 5 rubygems ruby-on-rails ruby-on-rails-4

我在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.
Run Code Online (Sandbox Code Playgroud)

Mas*_*man 9

运行此命令 -

sudo apt-get install libgmp-dev
Run Code Online (Sandbox Code Playgroud)

  • "......在**windows上安装导轨**" (8认同)

Zor*_*ran 5

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

您可以尝试安装RubyInstaller 开发工具包.此工具包有助于在Windows机器上使用Ruby的本机C/C++扩展.

安装说明可在此处找到.

安装完成后,运行gem update --system,然后再试一次.

希望这可以帮助!