Week 4, day 7

Leave me a message on my Chitter website on Heroku

View my Github repo for Chitter

chitter

Another little story from my escapades yesterday is about getting the Travis-CI build to pass on my pull request. I got the following error.

An error occurred while installing do_postgres (0.10.15), and Bundler cannot
continue.

Some searching turned up this.

You should be able to solve this error by adding the following to your .travis.yml:

before_install:
  - sudo apt-get update -qq
  - sudo apt-get install -qq postgresql-server-dev-9.3

Replace 9.3 with the Postgres version being used (9.1 is the default, 9.2 and 9.3 are also supported)

from Source

More tantalising tales of troubleshooting after the break.

That gave me another error:

The command "bundle exec rspec spec" exited with 1.
0.71s$ bundle exec cucumber
No such file or directory - features. You can use `cucumber --init` to get started.

I hadn't written any Cucumber tests so I went back and deleted it from the Rakefile. Next up.

$ bundle exec rspec spec
/home/travis/build/makersacademy/chitter-challenge/vendor/bundle/ruby/2.2.0/gems/data_objects-0.10.15/lib/data_objects/connection.rb:79:in `initialize': FATAL:  database "chitter_test" does not exist (DataObjects::ConnectionError)
The command "bundle exec rspec spec" exited with 1.

Travis-CI needed to know where the test database was:

Using PostgreSQL in your Builds
The default user for accessing the local PostgreSQL server is postgres and doesn't have a password set up.
Creating a database for your application requires just an extra line in your .travis.yml:

before_script:  
  - psql -c 'create database travis_ci_test;' -U postgres

From Source
EDIT: Of course I had to replace the "traviscitest" in the above command with "chitter_test" as deduced from the error message.

After that my Travis-CI debugging problems were over.

Coverage is at 100.0%.
Coverage report sent to Coveralls.
The command "bundle exec rspec spec" exited with 0.
Done. Your build exited with 0.

Coverage report:

Coveralls coverage report

Written on April 12, 2015