简体   繁体   English

travis-ci没有在android项目构建中切换到指定的ruby版本

[英]travis-ci not switching to the specified ruby version on an android project build

I am trying to run a ruby-based tool after a successful travis build for android, and in order to do that I need the rvm version to be 2.0.0, but even when I specified the rvm version in the .travis.yml file, doing bundle install provides the following error: 我试图在成功的travis构建android之后运行一个基于ruby的工具,为了做到这一点,我需要rvm版本为2.0.0,但即使我在.travis.yml文件中指定了rvm版本,执行bundle install会出现以下错误:

Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0 您的Ruby版本是1.9.3,但您的Gemfile指定为2.0.0

To try and get travis to recognize the ruby version I tried the following: 为了尝试让travis识别ruby版本,我尝试了以下方法:

  • Created a .ruby-version file with 2.0.0 使用2.0.0创建.ruby-version文件
  • Set the rvm version on .travis.yml like this: 在.travis.yml上设置rvm版本,如下所示:
 language: android rvm: - 2.0.0 ... after_script: - bundle install 

  • Set the ruby version on the Gemfile to match the desired rvm version: 在Gemfile上设置ruby版本以匹配所需的rvm版本:

    ruby: '2.0.0'

None of these settings worked and I always got the above message. 这些设置都不起作用,我总是收到上述消息。 Is there something else I'm forgetting to do? 还有别的我忘了吗?

Thanks and Regards, Federico.- 谢谢和问候,费德里科.-

As per travis-ci support: 根据travis-ci的支持:

"For Android builds, RVM only has 1.9.3 installed (and we do not expand the rvm section in .travis.yml for non-Ruby builds so the specifications in that section are ignored). To get Ruby 2.0.0 for your Android images, use: in your before_install section you can add the appropriate lines to install/enable via RVM, like: “对于Android版本,RVM只安装了1.9.3(我们不会扩展.travis.yml中的rvm部分用于非Ruby构建,因此忽略该部分中的规范。)为Android获取Ruby 2.0.0 images,use:在您的before_install部分中,您可以添加相应的行以通过RVM安装/启用,例如:

before_install:
   - rvm install 2.0.0

So basically I removed the 'rvm' section on travis.yml and added 'rvm install 2.0.0' on the before_install section and that solved the problem. 所以基本上我删除了travis.yml上的'rvm'部分,并在before_install部分添加了'rvm install 2.0.0',这解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM