我只是想从 ImageMagick v7 转换为 ImageMagick v6。这样做时,发生了这个错误。
捆绑安装无法正常工作。
好像 json 版本有问题。
如何修复此错误?
下面的环境
- ruby 2.3.1p112(2016-04-26 修订版 54768)[x86_64-darwin17]
- Rails -v(找不到 gem)(因为 bundle install 不能工作)
- json 列表 / json (默认: 1.8.3) multi_json (1.13.1, 1.11.2, 1.11.0)
- 捆绑器版本 1.16.4
- 麦克莫哈韦 10.14
当我在终端上进行捆绑安装时,出现此错误
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.......
Using rake 12.3.2
Using concurrent-ruby 1.1.4
Using i18n 0.9.5
Fetching json 1.8.6
Installing json 1.8.6 with native extensions
Errno::EPERM: Operation not permitted @ chmod_internal -
/Users/***/projects/***/vendor/bundle/ruby/2.3.0/gems/json-1.8.6/tests/test_json.rb
An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6' --source
'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rails was resolved to 4.2.6, which depends on
actionmailer was resolved to 4.2.6, which depends on
actionpack was resolved to 4.2.6, which depends on
actionview was resolved to 4.2.6, which depends on
rails-dom-testing was resolved to 1.0.9, which depends on
rails-deprecated_sanitizer was resolved to 1.0.3, which depends on
activesupport was resolved to 4.2.6, which depends on
json
我试图这样做是因为错误声明说确保
gem install json -v '1.8.6' --source 'https://rubygems.org/'
在捆绑之前成功
但结果显示如下
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted @ chmod_internal - /Users/***/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/json-1.8.6/tests/test_json.rb
我无法理解这个错误声明
Errno::EPERM: Operation not permitted @ chmod_internal -
另外,我看了很多,然后我按照这个 https://howchoo.com/g/m2u0mmuwzda/macos-mojave-fix-invalid-active-developer-path更新命令行工具
然后,我再次执行此命令,
sudo gem install json -v '1.8.6' --source 'https://rubygems.org/'
然后,就这样彻底成功了。
Building native extensions. This could take a while...
Successfully installed json-1.8.6
Parsing documentation for json-1.8.6
Installing ri documentation for json-1.8.6
Done installing documentation for json after 1 seconds
1 gem installed
但是,如果我进行捆绑安装,仍然无法正常工作:它们显示相同的错误。