[英]An error occurred while installing json (1.8.6), and Bundler cannot continue
I tried to run the bundle install
command and I got the following errors.我尝试运行
bundle install
命令,但出现以下错误。 After reading some stackoverflow posts, I also ran bundle update
.在阅读了一些 stackoverflow 帖子后,我还运行了
bundle update
。
I am still getting the issue of json ~ 1.8.6
gem (I guess).我仍然遇到
json ~ 1.8.6
gem 的问题(我猜)。
An error occurred while installing json (1.8.6), and Bundler cannot continue.
安装json(1.8.6)时出错,Bundler无法继续。 Make sure that
gem install json -v '1.8.6'
succeeds before bundling.在捆绑之前确保
gem install json -v '1.8.6'
成功。 Here the issue is not getting installation done properly.这里的问题是没有正确完成安装。
Older versions of json gem have some incompatibilities with newer ruby.较旧版本的 json gem 与较新的 ruby 存在一些不兼容。 Try to update json gem
bundle update json
尝试更新 json gem
bundle update json
This can be solved by doing the following这可以通过执行以下操作来解决
1. Installing the ruby development environment by running the following command(for Linux machines). 1.运行以下命令安装ruby开发环境(Linux机器)。
sudo apt-get install ruby
ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]' -dev
Read this post for more details .阅读这篇文章了解更多详情。
2. Now install the json -v '1.8.6'
gem by running the following command. 2.现在通过运行以下命令安装
json -v '1.8.6'
gem。
sudo gem install json -v '1.8.6'
This should solve the issue.这应该可以解决问题。 Now try running
bundle update
and bundle install
and it should work fine.现在尝试运行
bundle update
和bundle install
,它应该可以正常工作。
Thanks @TomLord and @Haider Ali for your inputs.感谢@TomLord和@Haider Ali的投入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.