Ruby

We use RVM to manage different Ruby versions. We set ruby-2.1.7 as the default version. Currently we do not load the Ruby version from your Gemfile. You can always change the Ruby version by running:

rvm use RUBY_VERSION_YOU_WANT_TO_USE

The following Ruby versions are preinstalled

  • ruby-2.1.7
  • jruby-1.7.21
  • jruby-1.7.22
  • jruby-1.7.23
  • jruby-1.7.24
  • jruby-1.7.25
  • jruby-1.7.26
  • jruby-9.0.4.0
  • jruby-9.0.5.0
  • jruby-9.1.0.0
  • jruby-9.1.1.0
  • jruby-9.1.2.0
  • jruby-9.1.3.0
  • jruby-9.1.4.0
  • jruby-9.1.5.0
  • jruby-9.1.7.0
  • ruby-1.8.7-p374
  • ruby-1.9.2-p320
  • ruby-1.9.3-p551
  • ruby-2.0.0-p648
  • ruby-2.1.0
  • ruby-2.1.1
  • ruby-2.1.2
  • ruby-2.1.3
  • ruby-2.1.4
  • ruby-2.1.5
  • ruby-2.1.6
  • ruby-2.1.7
  • ruby-2.1.8
  • ruby-2.1.9
  • ruby-2.2.0
  • ruby-2.2.1
  • ruby-2.2.2
  • ruby-2.2.3
  • ruby-2.2.4
  • ruby-2.2.5
  • ruby-2.2.6
  • ruby-2.3.0
  • ruby-2.3.1
  • ruby-2.3.2
  • ruby-2.3.3
  • ruby-2.4.0

Setting the Ruby version through a .ruby-version file

You can also use your .ruby-version file on Codeship. The .ruby-version file lives in the project root and its content is just your Ruby version, for example: 2.0.0-p195. You can just read the ruby version to use from that file:

rvm use $(cat .ruby-version) --install

One use case is that you can change your Ruby version for different branches.

Bundler

Bundler is preinstalled for all Ruby versions already included on the build VMs.

If you install a version not preinstalled on the VM already, you need to install bundler yourself by adding the following command to your setup steps

gem install bundler

Nokogiri

On Ruby 2.3 only, Nokogiri will fail to compile with the bundled libxml and libxslt libraries. To install the gem you need to use the system libraries instead.

# add the following command before running "bundle install"
bundle config build.nokogiri --use-system-libraries

Supported Test Frameworks

We support all Ruby based test frameworks from RSpec, Cucumber to Minitest or others.

Run with bundle exec

Make sure to run your commands with bundle exec (e.g. bundle exec rspec) so all commands you run are executed with the versions of the ruby gems you configured in your Gemfile.lock

Capybara

Capybara is supported out of the box with the selenium-webdriver , capybara-webkit or the poltergeist driver for phantomjs.

Parallelization Gems

In addition to parallelizing explicitly via parallel pipelines, there are a couple Rails gems that are popular ways to parallelize within your codebase.

While we do not officially support or integrate with these modules, many Codeship users find success speeding their tests up by using them. Note that it is possible for these gems to cause resource and build failure issues, as well.

Dependency Cache

Codeship automatically configures bundler to use the $HOME/cache/bundler directory, which we save between builds to optimize build performance. You can read this article to learn more about the dependency cache and how to clear it.

Need More Help?

Get in touch if you need more help, or post on Stack Overflow using the tag #Codeship.