0

Private pub gem needs additional Faye server to service message queues. It is started in parallel to rails server with command: rackup private_pub.ru -s thin -E production

This server is also needed in order some specs to pass. So I include its startup command in .travis.yml:

language: ruby
services:
  - postgresql
  - rack

before_script:
  - rackup private_pub.ru -s thin -E production
  - cp config/database.yml.travis config/database.yml
  - psql -c 'create database travis_ci_test;' -U postgres

but during build this command raises error:

0.00s$ rackup private_pub.ru -s thin -E production
/home/travis/build.sh: line 45: rackup: command not found
The command "rackup private_pub.ru -s thin -E production" failed and exited with 127 during .

What am I doing wrong?

Andrey Khataev
  • 1,303
  • 6
  • 20
  • 46

1 Answers1

1

The rackup command isn't being found. You'll want to run rackup using bundler exec like this (assuming rack, etc. is in your Gemfile):

before_script:
  - bundle exec rackup private_pub.ru -s thin -E production &

Using bundle exec uses what is in your gemfile instead of what is on the system (in this case, it's not on the system so you are getting an error). Here's a great link that explains a little bit more about rack and bundle exec: https://robots.thoughtbot.com/but-i-dont-want-to-bundle-exec

On Travis, you also do not need to add rack to services, just have it in your Gemfile. :)

sinthetix
  • 26
  • 3
  • Almost worked ) This process started and blocked the build. How could I fork it out of main build process, because it should be run in parallel to receive and send websocket messages? – Andrey Khataev Apr 07 '16 at 18:17
  • I thought I found it - I need to add & in the end of command line: - bundle exec rackup private_pub.ru -s thin -E production & – Andrey Khataev Apr 07 '16 at 19:30
  • 1
    Hey! Totally forgot that &, sorry about that! I edited the response for future users. :) – sinthetix Apr 08 '16 at 16:54