简体   繁体   English

Travis CI Ruby 以 1 退出

[英]Travis CI Ruby exited with 1

I built a new rails app and when I have configured the .travis.yml file it exits with one all the time.我构建了一个新的 rails 应用程序,当我配置了 .travis.yml 文件时,它一直以一个退出。 Here is my travis configuration:这是我的 travis 配置:

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这是 travis 给我的错误:来自 travis 控制台的屏幕截图

Are you correctly installing your gems (with bundle install ) before executing your rake commands?在执行 rake 命令之前,您是否正确安装了 gems(使用bundle install )? Seems like you would need sprockets before compiling the assets.在编译资产之前,您似乎需要链轮。

You have apparently create the initial application using the --skip-sprockets parameter.您显然已经使用--skip-sprockets参数创建了初始应用程序 As such, you have disable the use of the assets pipeline in your application and with that have disable the need (and possibility) to run rake assets:precompile .因此,您已经在应用程序中禁用了资产管道的使用,并因此禁用了运行rake assets:precompile的需要(和可能性)。

If you do need assets pipeline (and thus the rails-sprockets gem), you can re-enable it by adding如果您确实需要资产管道(因此需要rails-sprockets gem),您可以通过添加重新启用它

gem "sprockets-rails"

to your Gemfile and uncommenting the line到您的Gemfile并取消注释该行

# require "sprockets/railtie"

in your config/application.rb file.在您的config/application.rb文件中。 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 .如果你真的想跳过资产管道,你可以从你的.travis.yml删除对assets:precompile任务的.travis.yml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM