[fastlane] [gem] [rvm] [ruby]

Posted _不死鸟

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[fastlane] [gem] [rvm] [ruby]相关的知识,希望对你有一定的参考价值。

使用fastlane 实现快速持续的更新、在安装过程中 出现的一系列问题:

1.安装fastlane :sudo gem install fastlane

-错误:ERROR: Failed to build gem native extension.

#不要添加多个gem 源

#开始以为是gem 源的问题
#查看gem源
gem sources
# 删除默认的gem源 
gem sources --remove http://rubygems.org/
# 增加taobao作为gem源 
gem sources -a https://ruby.taobao.org/
# 查看当前的gem源
gem sources
*** CURRENT SOURCES ***

http://ruby.taobao.org
# 请确保只有 ruby.taobao.org

# 清空源缓存
gem sources -c
# 更新源缓存
gem sources -u

错误仍然存在;

然后查到是ruby版本的问题

2.更新ruby版本,安装rvm

http://blog.csdn.net/lissdy/article/details/9191351

http://stackoverflow.com/questions/3696564/how-to-update-ruby-to-1-9-x-on-mac

 curl -L get.rvm.io | bash -s stable 

测试是否安装正常 rvm -v 

3.rvm install ruby-2.1.4,报下面的错误

?  ~ git:(master) ? rvm install ruby-2.1.4
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.1.4.tar.bz2
Checking requirements for osx.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require: cannot load such file -- mach (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require    from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require    from /usr/local/Library/Homebrew/global.rb:3:in `<top (required)>    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require    from /usr/local/Library/brew.rb:16:in `<main>ERROR: /bin is not writable - it is required for Homebrew, try brew doctor to fix it!
Requirements installation failed with status: 1.

然后这样处理:

$ brew install openssl  # if you want to install all dependencies run ‘rvm requirements‘
$ rmv reinstall|install ruby-2.1.4

这里参考了http://stackoverflow.com/questions/18863211/homebrew-permissions-mess

最后就顺利安装fastlane了。

 

以上是关于[fastlane] [gem] [rvm] [ruby]的主要内容,如果未能解决你的问题,请参考以下文章

iOS 项目持续集成:Jenkins + Fastlane

RVM:卸载 gemset 的所有 gem

rvm pod gem 等常用命令

rvm,ubuntu 11.10 gem 阻止服务器启动

整理Ruby相关的各种概念(rvm, gem, bundle, rake, rails等)

警告! PATH 设置不正确,/Users/me/.rvm/gems/ruby-2.7.3/bin 不在首位