I'm currently trying to use TravisCI properly for my rails app but I'm a bit stuck with the problem I'm facing.
In my .travis.yml
I've got this :
language: ruby
before_install:
- gem install bundler
rvm:
- 2.0.0
env:
- DB=sqlite
- DB=mysql
- DB=postgresql
script:
- rake db:migrate
- rake db:test:prepare
And in my Gemfile I precise Ruby version : ruby "2.0.0"
With this .travis.yml the tests fails saying to me :
$ gem --version
2.0.3
$ bundle install --deployment
Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0
But when I modify my .travis.yml like this :
language: ruby
before_install:
- gem install bundler
rvm:
- 1.9.3
- 2.0.0
env:
- DB=sqlite
- DB=mysql
- DB=postgresql
script:
- rake db:migrate
- rake db:test:prepare
Travis CI runs the test twice (once for 1.9.3 version and once for 2.0.0 version) and fails with 1.9.3 version and succeed with 2.0.0 version.
What am I doing wrong in order to just pass the test with 2.0.0 ruby version ?
Cordially rob
I found what was wrong, TravisCI was looking for a .travis.yml in each branch but I only had one in my master branch (I thought TravisCI was only checking master branch). I added a .travis.yml and all was ok.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With