I built a new rails app and when I have configured the .travis.yml file it exits with one all the time.
Here is my travis configuration:
language: ruby
node_js:
- 12
cache:
bundler: true
yarn: true
services:
- redis-server
sudo: required
before_install:
- sudo apt-get update
- sudo apt-get install google-chrome-stable
addons:
postgresql: '9.6'
before_script:
- psql -c 'create database product_hunt_clone_test;' -U postgres
script:
- bundle install
- bundle exec rake db:schema:load
- bundle exec rake db:test:prepare
- SECRET_KEY_BASE=a RAILS_ENV=production bundle exec rake assets:precompile
- bundle exec rake test
- bundle exec rake test:system
and here are the errors travis is giving me:
screenshot from travis console
2
Answers
Are you correctly installing your gems (with
bundle install
) before executing your rake commands? Seems like you would need sprockets before compiling the assets.You have apparently create the initial application using the
--skip-sprockets
parameter. As such, you have disable the use of the assets pipeline in your application and with that have disable the need (and possibility) to runrake assets:precompile
.If you do need assets pipeline (and thus the
rails-sprockets
gem), you can re-enable it by addingto your
Gemfile
and uncommenting the linein your
config/application.rb
file. You would also need to create the asset files as necessary. Please refer to the documentation for the assets pipeline for details.If you actually want to skip the assets pipeline, you can just remove the call to the
assets:precompile
task from your.travis.yml
.