OSX El Capitan,gem install" ERROR:执行gem时...(Errno :: EINVAL)无效的参数"

时间:2016-10-04 22:51:59

标签: rubygems cocoapods bundler osx-elcapitan gem-bundler

任何宝石的宝石安装都失败了(例如捆绑包,cocoapods)。

from moviepy.editor import *

背景

在运行OSX El Capitan v10.11.6(15G31)的新Macbook(2015年中)上,我开始为开发工作进行设置并安装了xcode8,brew&红宝石。我的$ gem install bundler ERROR: While executing gem ... (Errno::EINVAL) Invalid argument

gem env

一些现有帖子:

许多现有帖子都集中在另一个类似的错误上,这个错误与"无根" El Capitan的安全功能:

$ gem env RubyGems Environment:   - RUBYGEMS VERSION: 2.5.1   - RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-darwin15]   - INSTALLATION DIRECTORY: /usr/local/bin   - USER INSTALLATION DIRECTORY: /Users/__username__/.gem/ruby/2.3.0   - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby   - EXECUTABLE DIRECTORY: /usr/local/bin/bin   - SPEC CACHE DIRECTORY: /Users/__username__/.gem/specs   - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.3.1_1/etc   - RUBYGEMS PLATFORMS:     - ruby     - x86_64-darwin-15   - GEM PATHS:      - /usr/local/bin      - /Users/__username__/.gem/ruby/2.3.0      - /usr/local/lib/ruby/gems/2.3.0      - /usr/local/Cellar/ruby/2.3.1_1/lib/ruby/gems/2.3.0   - GEM CONFIGURATION:      - :update_sources => true      - :verbose => false      - :backtrace => false      - :bulk_threshold => 1000      - "gem" => "-n/usr/local/bin"   - REMOTE SOURCES:      - https://rubygems.org/   - SHELL PATH:      - /Library/Frameworks/Python.framework/Versions/3.4/bin      - /Library/Frameworks/Python.framework/Versions/3.4/bin

一些Errno :: EPERM相关帖子:1: CocoaPods issue 36802: Stackoverflow Windows73: Bundler issue 4065

什么行不通:

ERROR: While executing gem ... (Errno::EPERM) Operation not permitted 变体

gem install

将$ GEM_HOME设置为/ usr / local / bin和〜/ .gems。

$ sudo gem install bundler -n /usr/local/bin -V

"无根"禁用

echo $GEM_HOME /usr/local/bin echo $GEM_HOME ~/.gems

1 个答案:

答案 0 :(得分:0)

似乎rubygems版本2.5.1有一些问题。我安装了rubygems版本2.4.5.1附带的旧版ruby 2.2.5版。

使用brew install rubybrew uninstall ruby来解决问题(Errno :: EINVAL)。

gem env RubyGems Environment: - RUBYGEMS VERSION: 2.4.5.1 - RUBY VERSION: 2.2.5 (2016-04-26 patchlevel 319) [x86_64-darwin15] - INSTALLATION DIRECTORY: /Users/ashok.meena/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0 - RUBY EXECUTABLE: /Users/__username__/.rbenv/versions/2.2.5/bin/ruby - EXECUTABLE DIRECTORY: /Users/__username__/.rbenv/versions/2.2.5/bin - SPEC CACHE DIRECTORY: /Users/__username__/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: /Users/__username__/.rbenv/versions/2.2.5/etc - RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-15 - GEM PATHS: - /Users/__username__/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0 - /Users/__username__/.gem/ruby/2.2.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => false - :backtrace => false - :bulk_threshold => 1000 - "gem" => "-n/usr/local/bin" - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /Users/__username__/.rbenv/versions/2.2.5/bin - /usr/local/Cellar/rbenv/1.0.0/libexec