[没有运行Postgres时如何在AWS CodeBuild中运行RSpec测试

问题描述 投票:0回答:1

通常,问题是-我想在我的AWS CodeBuild实例上运行测试。

特别是,我的应用程序在Ruby on Rails 2.5.3上。我已经在Gemfile中包含了“ pg”,但没有得到可用于运行Rails测试的PG实例。

这是我的buildspec.yml文件:

version: 0.2
phases:
  install:
    runtime-versions:
      java: openjdk8
      android: 28
      ruby: 2.6 #remove the .3 if there are errors here
      nodejs: 8
    commands:
      - apt update
      - apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev -y
      - curl -sL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash -
      - echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
      - echo 'eval "$(rbenv init -)"' >> ~/.bashrc
      #- source ~/.bashrc
      - rbenv install 2.5.3
      - rbenv global 2.5.3
      - ruby -v
      - exec bash

      - gem update --system
      - echo Installing Bundler...
      - rm -r /root/.rbenv/versions/2.5.3/bin/bundle
      - gem install bundler
      - bundle install
      - echo Installing node dependencies
      - yarn install
  pre_build:
    commands:
      - echo Commands from Codeship Setup Suite...
      - if [[ $(cat Gemfile.lock | grep "wkhtmltopdf-binary-edge (0.12.5.0)") ]]; then wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb; sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb; fi
      - if [[ $(bundle exec gem list -i "^danger$") == true ]]; then bundle exec danger; fi
      - cp config/database.yml.example config/database.yml
      - sed -i "s|5432|5434|" "config/database.yml"
      - echo Preparing database to run tests...
      - service postgresql restart
      - RAILS_ENV=test bundle exec rake db:setup    #was db:create
      - RAILS_ENV=test bundle exec rake parallel:create
      - RAILS_ENV=test bundle exec rake parallel:prepared
  build:
    commands:
      - echo Codeship Parallel Rspec Test Commands...
      - RAILS_ENV=test bundle exec parallel_rspec spec --single 'spec/features' --isolate --test-options "--order=random"

以及终端输出的最后500行:

[Container] 2019/10/09 21:13:52 Running command echo Installing Bundler... 
Installing Bundler... 

[Container] 2019/10/09 21:13:52 Running command rm -r /root/.rbenv/versions/2.5.3/bin/bundle 

[Container] 2019/10/09 21:13:52 Running command gem install bundler 
/usr/local/rbenv/rbenv.d/exec/gem-rehash/rubygems_plugin.rb:6: warning: Insecure world writable dir /go/bin in PATH, mode 040777 
Successfully installed bundler-2.0.2 
Parsing documentation for bundler-2.0.2 
Installing ri documentation for bundler-2.0.2 
Done installing documentation for bundler after 2 seconds 
1 gem installed 

[Container] 2019/10/09 21:13:55 Running command bundle install 
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and 
installing your bundle as root will break this application for all non-root 
users on this machine. 
Fetching gem metadata from https://rubygems.org/......... 
Fetching https://github.com/boatrite/awesome_print.git 
Fetching https://github.com/mobiledoorman/paperclip.git 
Fetching https://github.com/boatrite/parallel_tests.git 
Fetching https://github.com/tenforwardconsulting/pay_simple.git 
Fetching https://[email protected]/tenforwardconsulting/rent_track.git 
Fetching rake 12.3.2 
Installing rake 12.3.2 
Fetching concurrent-ruby 1.1.5 
Installing concurrent-ruby 1.1.5 
Fetching i18n 0.9.5 
Installing i18n 0.9.5 
Fetching minitest 5.11.3 
Installing minitest 5.11.3 
Fetching thread_safe 0.3.6 
Installing thread_safe 0.3.6 
Fetching tzinfo 1.2.5 
Installing tzinfo 1.2.5 
Fetching activesupport 5.2.3 
Installing activesupport 5.2.3 
Fetching builder 3.2.3 
Installing builder 3.2.3 
Fetching erubi 1.8.0 
Installing erubi 1.8.0 
Fetching mini_portile2 2.4.0 
Installing mini_portile2 2.4.0 
Fetching nokogiri 1.10.4 
Installing nokogiri 1.10.4 with native extensions 
Fetching rails-dom-testing 2.0.3 
Installing rails-dom-testing 2.0.3 
Fetching crass 1.0.4 
Installing crass 1.0.4 
Fetching loofah 2.2.3 
Installing loofah 2.2.3 
Fetching rails-html-sanitizer 1.0.4 
Installing rails-html-sanitizer 1.0.4 
Fetching actionview 5.2.3 
Installing actionview 5.2.3 
Fetching rack 2.0.7 
Installing rack 2.0.7 
Fetching rack-test 1.1.0 
Installing rack-test 1.1.0 
Fetching actionpack 5.2.3 
Installing actionpack 5.2.3 
Fetching nio4r 2.3.1 
Installing nio4r 2.3.1 with native extensions 
Fetching websocket-extensions 0.1.3 
Installing websocket-extensions 0.1.3 
Fetching websocket-driver 0.7.0 
Installing websocket-driver 0.7.0 with native extensions 
Fetching actioncable 5.2.3 
Installing actioncable 5.2.3 
Fetching globalid 0.4.2 
Installing globalid 0.4.2 
Fetching activejob 5.2.3 
Installing activejob 5.2.3 
Fetching mini_mime 1.0.1 
Installing mini_mime 1.0.1 
Fetching mail 2.7.1 
Installing mail 2.7.1 
Fetching actionmailer 5.2.3 
Installing actionmailer 5.2.3 
Fetching activemodel 5.2.3 
Installing activemodel 5.2.3 
Fetching activemodel-serializers-xml 1.0.2 
Installing activemodel-serializers-xml 1.0.2 
Fetching arel 9.0.0 
Installing arel 9.0.0 
Fetching activerecord 5.2.3 
Installing activerecord 5.2.3 
Fetching pg 0.21.0 
Installing pg 0.21.0 with native extensions 
Fetching activerecord-postgresql-adapter 0.0.1 
Installing activerecord-postgresql-adapter 0.0.1 
Fetching mimemagic 0.3.3 
Installing mimemagic 0.3.3 
Fetching marcel 0.3.3 
Installing marcel 0.3.3 
Fetching activestorage 5.2.3 
Installing activestorage 5.2.3 
Fetching public_suffix 3.0.3 
Installing public_suffix 3.0.3 
Fetching addressable 2.6.0 
Installing addressable 2.6.0 
Fetching net-ssh 4.2.0 
Installing net-ssh 4.2.0 
Fetching net-scp 1.2.1 
Installing net-scp 1.2.1 
Fetching sshkit 1.15.1 
Installing sshkit 1.15.1 
Fetching airbrussh 1.3.0 
Installing airbrussh 1.3.0 
Fetching gyoku 1.3.1 
Installing gyoku 1.3.1 
Fetching akami 1.3.1 
Installing akami 1.3.1 
Using awesome_print 1.8.0 from https://github.com/boatrite/awesome_print.git (at zb-ap-action-controller-parameters@e04c5c1) 
Fetching aws-eventstream 1.0.3 
Installing aws-eventstream 1.0.3 
Fetching aws-partitions 1.164.0 
Installing aws-partitions 1.164.0 
Fetching aws-sigv4 1.1.0 
Installing aws-sigv4 1.1.0 
Fetching jmespath 1.4.0 
Installing jmespath 1.4.0 
Fetching aws-sdk-core 3.52.1 
Installing aws-sdk-core 3.52.1 
Fetching aws-sdk-kms 1.20.0 
Installing aws-sdk-kms 1.20.0 
Fetching aws-sdk-lambda 1.25.0 
Installing aws-sdk-lambda 1.25.0 
Fetching aws-sdk-rds 1.52.0 
Installing aws-sdk-rds 1.52.0 
Fetching aws-sdk-route53 1.24.0 
Installing aws-sdk-route53 1.24.0 
Fetching aws-sdk-s3 1.39.0 
Installing aws-sdk-s3 1.39.0 
Fetching bcrypt 3.1.13 
Installing bcrypt 3.1.13 with native extensions 
Fetching coderay 1.1.2 
Installing coderay 1.1.2 
Fetching better_errors 2.4.0 
Installing better_errors 2.4.0 
Fetching bindex 0.5.0 
Installing bindex 0.5.0 with native extensions 
Fetching debug_inspector 0.0.3 
Installing debug_inspector 0.0.3 with native extensions 
Fetching binding_of_caller 0.8.0 
Installing binding_of_caller 0.8.0 with native extensions 
Fetching browser 2.5.2 
Installing browser 2.5.2 
Fetching uniform_notifier 1.12.1 
Installing uniform_notifier 1.12.1 
Fetching bullet 6.0.0 
Installing bullet 6.0.0 
Using bundler 1.17.3 
Fetching thor 0.20.3 
Installing thor 0.20.3 
Fetching bundler-audit 0.6.1 
Installing bundler-audit 0.6.1 
Fetching business_time 0.9.3 
Installing business_time 0.9.3 
Fetching byebug 9.1.0 
Installing byebug 9.1.0 with native extensions 
Fetching cancancan 2.1.2 
Installing cancancan 2.1.2 
Fetching capistrano 3.10.0 
Installing capistrano 3.10.0 
Fetching capistrano-bundler 1.3.0 
Installing capistrano-bundler 1.3.0 
Fetching capistrano-rails 1.3.1 
Installing capistrano-rails 1.3.1 
Fetching xpath 2.1.0 
Installing xpath 2.1.0 
Fetching capybara 2.16.1 
Installing capybara 2.16.1 
Fetching ffi 1.9.25 
Installing ffi 1.9.25 with native extensions 
Fetching childprocess 0.9.0 
Installing childprocess 0.9.0 
Fetching chronic 0.10.2 
Installing chronic 0.10.2 
Fetching chunky_png 1.3.8 
Installing chunky_png 1.3.8 
Fetching claide 1.0.2 
Installing claide 1.0.2 
Fetching colored2 3.1.2 
Installing colored2 3.1.2 
Fetching cork 0.3.0 
Installing cork 0.3.0 
Fetching nap 1.1.0 
Installing nap 1.1.0 
Fetching open4 1.3.4 
Installing open4 1.3.4 
Fetching claide-plugins 0.9.2 
Installing claide-plugins 0.9.2 
Fetching climate_control 0.2.0 
Installing climate_control 0.2.0 
Fetching cliver 0.3.2 
Installing cliver 0.3.2 
Fetching json 1.8.6 
Installing json 1.8.6 with native extensions 
Fetching multi_xml 0.6.0 
Installing multi_xml 0.6.0 
Fetching httparty 0.13.7 
Installing httparty 0.13.7 
Fetching cloud_five_push 1.0.0 
Installing cloud_five_push 1.0.0 
Fetching cocoon 1.2.11 
Installing cocoon 1.2.11 
Fetching coffee-script-source 1.12.2 
Installing coffee-script-source 1.12.2 
Fetching execjs 2.7.0 
Installing execjs 2.7.0 
Fetching coffee-script 2.4.1 
Installing coffee-script 2.4.1 
Fetching method_source 0.9.2 
Installing method_source 0.9.2 
Fetching railties 5.2.3 
Installing railties 5.2.3 
Fetching coffee-rails 4.2.2 
Installing coffee-rails 4.2.2 
Fetching highline 2.0.2 
Installing highline 2.0.2 
Fetching commander 4.4.7 
Installing commander 4.4.7 
Fetching multi_json 1.12.2 
Installing multi_json 1.12.2 
Fetching sass 3.4.25 
Installing sass 3.4.25 
Fetching compass-core 1.0.3 
Installing compass-core 1.0.3 
Fetching compass-import-once 1.0.5 
Installing compass-import-once 1.0.5 
Fetching rb-fsevent 0.10.2 
Installing rb-fsevent 0.10.2 
Fetching rb-inotify 0.9.10 
Installing rb-inotify 0.9.10 
Fetching compass 1.0.3 
Installing compass 1.0.3 
Fetching sprockets 3.7.2 
Installing sprockets 3.7.2 
Fetching sprockets-rails 3.2.1 
Installing sprockets-rails 3.2.1 
Fetching tilt 2.0.8 
Installing tilt 2.0.8 
Fetching sass-rails 5.0.7 
Installing sass-rails 5.0.7 
Fetching compass-rails 3.0.2 
Installing compass-rails 3.0.2 
Fetching i18n_data 0.8.0 
Installing i18n_data 0.8.0 
Fetching money 6.10.0 
Installing money 6.10.0 
Fetching sixarm_ruby_unaccent 1.2.0 
Installing sixarm_ruby_unaccent 1.2.0 
Fetching unicode_utils 1.4.0 
Installing unicode_utils 1.4.0 
Fetching countries 2.1.2 
Installing countries 2.1.2 
Fetching safe_yaml 1.0.4 
Installing safe_yaml 1.0.4 
Fetching crack 0.4.3 
Installing crack 0.4.3 
Fetching css_parser 1.6.0 
Installing css_parser 1.6.0 
Fetching daemons 1.2.5 
Installing daemons 1.2.5 
Fetching dalli 2.7.8 
Installing dalli 2.7.8 
Fetching multipart-post 2.1.1 
Installing multipart-post 2.1.1 
Fetching faraday 0.15.4 
Installing faraday 0.15.4 
Fetching faraday-http-cache 2.0.0 
Installing faraday-http-cache 2.0.0 
Fetching git 1.5.0 
Installing git 1.5.0 
Fetching kramdown 2.1.0 
Installing kramdown 2.1.0 
Fetching kramdown-parser-gfm 1.0.1 
Installing kramdown-parser-gfm 1.0.1 
Fetching no_proxy_fix 0.1.2 
Installing no_proxy_fix 0.1.2 
Fetching sawyer 0.8.2 
Installing sawyer 0.8.2 
Fetching octokit 4.14.0 
Installing octokit 4.14.0 
Fetching unicode-display_width 1.6.0 
Installing unicode-display_width 1.6.0 
Fetching terminal-table 1.8.0 
Installing terminal-table 1.8.0 
Fetching danger 6.0.9 
Installing danger 6.0.9 
Fetching danger-plugin-api 1.0.0 
Installing danger-plugin-api 1.0.0 
Fetching danger-eslint 0.1.4 
Installing danger-eslint 0.1.4 
Fetching danger-welcome_message 0.0.1 
Installing danger-welcome_message 0.0.1 
Fetching database_cleaner 1.6.2 
Installing database_cleaner 1.6.2 
Fetching deepsort 0.4.1 
Installing deepsort 0.4.1 
Fetching delayed_job 4.1.5 
Installing delayed_job 4.1.5 
Fetching delayed_job_active_record 4.1.3 
Installing delayed_job_active_record 4.1.3 
Fetching rack-protection 2.0.5 
Installing rack-protection 2.0.5 
Fetching mustermann 1.0.3 
Installing mustermann 1.0.3 
Fetching sinatra 2.0.5 
Installing sinatra 2.0.5 
Fetching delayed_job_web 1.4.3 
Installing delayed_job_web 1.4.3 
Fetching orm_adapter 0.5.0 
Installing orm_adapter 0.5.0 
Fetching responders 3.0.0 
Installing responders 3.0.0 
Fetching warden 1.2.8 
Installing warden 1.2.8 
Fetching devise 4.7.1 
Installing devise 4.7.1 
Fetching diff-lcs 1.3 
Installing diff-lcs 1.3 
Fetching diffy 3.2.1 
Installing diffy 3.2.1 
Fetching docile 1.1.5 
Installing docile 1.1.5 
Fetching dotenv 0.7.0 
Installing dotenv 0.7.0 
Fetching request_store 1.3.2 
Installing request_store 1.3.2 
Fetching draper 3.0.1 
Installing draper 3.0.1 
Fetching erubis 2.7.0 
Installing erubis 2.7.0 
Fetching factory_bot 4.8.2 
Installing factory_bot 4.8.2 
Fetching factory_bot_rails 4.8.2 
Installing factory_bot_rails 4.8.2 
Fetching faker 1.9.1 
Installing faker 1.9.1 
Fetching figaro 1.1.1 
Installing figaro 1.1.1 
Fetching flipper 0.16.0 
Installing flipper 0.16.0 
Fetching flipper-active_record 0.16.0 
Installing flipper-active_record 0.16.0 
Fetching flipper-ui 0.16.0 
Installing flipper-ui 0.16.0 
Fetching font-awesome-sass 4.7.0 
Installing font-awesome-sass 4.7.0 
Fetching foreman 0.64.0 
Installing foreman 0.64.0 
Fetching formatador 0.2.5 
Installing formatador 0.2.5 
Fetching gon 6.2.0 
Installing gon 6.2.0 
Fetching ruby_dep 1.5.0 
Installing ruby_dep 1.5.0 
Fetching listen 3.1.5 
Installing listen 3.1.5 
Fetching lumberjack 1.0.12 
Installing lumberjack 1.0.12 
Fetching nenv 0.3.0 
Installing nenv 0.3.0 
Fetching shellany 0.0.1 
Installing shellany 0.0.1 
Fetching notiffany 0.1.1 
Installing notiffany 0.1.1 
Fetching pry 0.11.3 
Installing pry 0.11.3 
Fetching guard 2.14.1 
Installing guard 2.14.1 
Fetching guard-compat 1.2.1 
Installing guard-compat 1.2.1 
Fetching rspec-support 3.7.0 
Installing rspec-support 3.7.0 
Fetching rspec-core 3.7.0 
Installing rspec-core 3.7.0 
Fetching rspec-expectations 3.7.0 
Installing rspec-expectations 3.7.0 
Fetching rspec-mocks 3.7.0 
Installing rspec-mocks 3.7.0 
Fetching rspec 3.7.0 
Installing rspec 3.7.0 
Fetching guard-rspec 4.7.3 
Installing guard-rspec 4.7.3 
Fetching temple 0.8.0 
Installing temple 0.8.0 
Fetching hamlit 2.8.5 
Installing hamlit 2.8.5 with native extensions 
Fetching hashdiff 0.3.7 
Installing hashdiff 0.3.7 
Fetching htmlentities 4.3.4 
Installing htmlentities 4.3.4 
Fetching socksify 1.7.1 
Installing socksify 1.7.1 
Fetching httpi 2.4.4 
Installing httpi 2.4.4 
Fetching icalendar 2.4.1 
Installing icalendar 2.4.1 
Fetching jbuilder 2.7.0 
Installing jbuilder 2.7.0 
Fetching jefferies_tube 1.0.5 
Installing jefferies_tube 1.0.5 
Fetching jquery-rails 4.3.1 
Installing jquery-rails 4.3.1 
Fetching jquery-ui-rails 6.0.1 
Installing jquery-ui-rails 6.0.1 
Fetching jwt 2.1.0 
Installing jwt 2.1.0 
Fetching launchy 2.4.3 
Installing launchy 2.4.3 
Fetching lazy_priority_queue 0.1.1 
Installing lazy_priority_queue 0.1.1 
Fetching letter_opener 1.4.1 
Installing letter_opener 1.4.1 
Fetching letter_opener_web 1.3.2 
Installing letter_opener_web 1.3.2 
Fetching lograge 0.10.0 
Installing lograge 0.10.0 
Fetching mime-types-data 3.2019.0331 
Installing mime-types-data 3.2019.0331 
Fetching mime-types 3.2.2 
Installing mime-types 3.2.2 
Fetching newrelic_rpm 4.6.0.338 
Installing newrelic_rpm 4.6.0.338 
Fetching niceql 0.1.25 
Installing niceql 0.1.25 
Fetching nori 2.6.0 
Installing nori 2.6.0 
Fetching paper_trail 9.1.1 
Installing paper_trail 9.1.1 
Fetching terrapin 0.6.0 
Installing terrapin 0.6.0 
Using paperclip 6.1.0 from https://github.com/mobiledoorman/paperclip.git (at paperclip-md-fixes@d4fd8c1) 
Fetching parallel 1.12.1 
Installing parallel 1.12.1 
Using parallel_tests 2.22.0 from https://github.com/boatrite/parallel_tests.git (at zb-hacks@f5e43c3) 
Using pay_simple 0.0.1 from https://github.com/tenforwardconsulting/pay_simple.git (at master@b6465fb) 
Fetching pivotal_git_scripts 1.4.0 
Installing pivotal_git_scripts 1.4.0 
Fetching plist 3.5.0 
Installing plist 3.5.0 
Fetching poltergeist 1.16.0 
Installing poltergeist 1.16.0 
Fetching premailer 1.11.1 
Installing premailer 1.11.1 
Fetching premailer-rails 1.10.1 
Installing premailer-rails 1.10.1 
Fetching pry-byebug 3.5.1 
Installing pry-byebug 3.5.1 
Fetching pry-rails 0.3.6 
Installing pry-rails 0.3.6 
Fetching puma 3.10.0 
Installing puma 3.10.0 with native extensions 
Fetching pundit 2.0.0 
Installing pundit 2.0.0 
Fetching query_diet 0.6.2 
Installing query_diet 0.6.2 
Fetching rack-cors 1.0.2 
Installing rack-cors 1.0.2 
Fetching rack-proxy 0.6.4 
Installing rack-proxy 0.6.4 
Fetching rack-timeout 0.5.1 
Installing rack-timeout 0.5.1 
Fetching rails 5.2.3 
Installing rails 5.2.3 
Fetching rails-controller-testing 1.0.2 
Installing rails-controller-testing 1.0.2 
Using rent_track 0.0.4 from https://[email protected]/tenforwardconsulting/rent_track.git (at master@8eae3dd) 
Fetching stream 0.5 
Installing stream 0.5 
Fetching rgl 0.5.3 
Installing rgl 0.5.3 
Fetching rmagick 2.16.0 
Installing rmagick 2.16.0 with native extensions 
Fetching rollbar 2.15.5 
Installing rollbar 2.15.5 
Fetching rspec-json_expectations 2.2.0 
Installing rspec-json_expectations 2.2.0 
Fetching rspec-rails 3.7.2 
Installing rspec-rails 3.7.2 
Fetching rspec-retry 0.6.1 
Installing rspec-retry 0.6.1 
Fetching ruby-ole 1.2.12.1 
Installing ruby-ole 1.2.12.1 
Fetching rubyzip 1.3.0 
Installing rubyzip 1.3.0 
Fetching wasabi 3.5.0 
Installing wasabi 3.5.0 
Fetching savon 2.12.0 
Installing savon 2.12.0 
Fetching select2-rails 4.0.3 
Installing select2-rails 4.0.3 
Fetching selenium-webdriver 3.14.0 
Installing selenium-webdriver 3.14.0 
Fetching simple_form 5.0.0 
Installing simple_form 5.0.0 
Fetching simplecov-html 0.10.2 
Installing simplecov-html 0.10.2 
Fetching simplecov 0.15.1 
Installing simplecov 0.15.1 
Fetching spreadsheet 1.1.5 
Installing spreadsheet 1.1.5 
Fetching strong_migrations 0.4.0 
Installing strong_migrations 0.4.0 
Fetching subspace 2.0.4 
Installing subspace 2.0.4 
Fetching timecop 0.9.1 
Installing timecop 0.9.1 
Fetching twilio-ruby 5.5.1 
Installing twilio-ruby 5.5.1 
Fetching uglifier 4.0.1 
Installing uglifier 4.0.1 
Fetching vcr 4.0.0 
Installing vcr 4.0.0 
Fetching web-console 3.6.2 
Installing web-console 3.6.2 
Fetching webdrivers 3.8.0 
Installing webdrivers 3.8.0 
Fetching webmock 3.1.1 
Installing webmock 3.1.1 
Fetching webpacker 3.5.3 
Installing webpacker 3.5.3 
Fetching whenever 0.10.0 
Installing whenever 0.10.0 
Fetching wicked_pdf 1.1.0 
Installing wicked_pdf 1.1.0 
Fetching will_paginate 3.1.7 
Installing will_paginate 3.1.7 
Fetching wkhtmltopdf-binary-edge 0.12.5.0 
Installing wkhtmltopdf-binary-edge 0.12.5.0 
Fetching wysiwyg-rails 2.8.5 
Installing wysiwyg-rails 2.8.5 
Bundle complete! 103 Gemfile dependencies, 259 gems now installed. 
Use `bundle info [gemname]` to see where a bundled gem is installed. 
Post-install message from httparty: 
When you HTTParty, you must party hard! 
Post-install message from compass: 
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks! 
Post-install message from icalendar: 
HEADS UP! iCalendar 2.0 is not backwards-compatible with 1.x. Please see the README for the new syntax 

HEADS UP! icalendar 2.2.0 switches to non-strict parsing as default. Please see the README if you 
rely on strict parsing for information on how to enable it. 

ActiveSupport is required for TimeWithZone support, but not required for general use. 
Post-install message from paperclip: 
################################################## 
#  NOTE FOR UPGRADING FROM 4.3.0 OR EARLIER      # 
################################################## 

Paperclip is now compatible with aws-sdk-s3. 

If you are using S3 storage, aws-sdk-s3 requires you to make a few small 
changes: 

* You must set the `s3_region` 
* If you are explicitly setting permissions anywhere, such as in an initializer, 
  note that the format of the permissions changed from using an underscore to 
  using a hyphen. For example, `:public_read` needs to be changed to 
  `public-read`. 

For a walkthrough of upgrading from 4 to *5* (not 6) and aws-sdk >= 2.0 you can watch 
http://rubythursday.com/episodes/ruby-snack-27-upgrade-paperclip-and-aws-sdk-in-prep-for-rails-5 

[Container] 2019/10/09 21:15:52 Running command echo Installing node dependencies 
Installing node dependencies 

[Container] 2019/10/09 21:15:52 Running command yarn install 
yarn install v1.17.3 
[1/4] Resolving packages... 
[2/4] Fetching packages... 
info [email protected]: The platform "linux" is incompatible with this module. 
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. 
[3/4] Linking dependencies... 
warning "@rails/webpacker > [email protected]" has unmet peer dependency "caniuse-lite@^1.0.30000697". 
warning " > [email protected]" has unmet peer dependency "css-loader@*". 
warning " > [email protected]" has unmet peer dependency "webpack@^4.1.0 || ^5.0.0-0". 
warning " > [email protected]" has incorrect peer dependency "eslint@^5.0.0". 
warning "eslint-plugin-vue > [email protected]" has incorrect peer dependency "eslint@^5.0.0". 
warning " > [email protected]" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0". 
warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0". 
[4/4] Building fresh packages... 
Done in 23.56s. 

[Container] 2019/10/09 21:16:16 Phase complete: INSTALL State: SUCCEEDED 
[Container] 2019/10/09 21:16:16 Phase context status code:  Message:  
[Container] 2019/10/09 21:16:16 Entering phase PRE_BUILD 
[Container] 2019/10/09 21:16:16 Running command echo Commands from Codeship Setup Suite... 
Commands from Codeship Setup Suite... 

[Container] 2019/10/09 21:16:16 Running command if [[ $(cat Gemfile.lock | grep "wkhtmltopdf-binary-edge (0.12.5.0)") ]]; then wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb; sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb; fi 
/codebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: [[: not found 

[Container] 2019/10/09 21:16:16 Running command if [[ $(bundle exec gem list -i "^danger$") == true ]]; then bundle exec danger; fi 
/codebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: [[: not found 

[Container] 2019/10/09 21:16:17 Running command cp config/database.yml.example config/database.yml 

[Container] 2019/10/09 21:16:17 Running command sed -i "s|5432|5434|" "config/database.yml" 

[Container] 2019/10/09 21:16:17 Running command echo Preparing database to run tests... 
Preparing database to run tests... 

[Container] 2019/10/09 21:16:17 Running command RAILS_ENV=test bundle exec rake db:setup 
could not connect to server: No such file or directory 
    Is the server running locally and accepting 
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? 
Couldn't create 'tenant_connect_test' database. Please check your configuration. 
rake aborted! 
PG::ConnectionBad: could not connect to server: No such file or directory 
    Is the server running locally and accepting 
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? 
/root/.rbenv/versions/2.5.3/bin/bundle:23:in `load' 
/root/.rbenv/versions/2.5.3/bin/bundle:23:in `<main>' 
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create 
(See full trace by running task with --trace) 

[Container] 2019/10/09 21:16:24 Command did not exit successfully RAILS_ENV=test bundle exec rake db:setup exit status 1 
[Container] 2019/10/09 21:16:24 Phase complete: PRE_BUILD State: FAILED 
[Container] 2019/10/09 21:16:24 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: RAILS_ENV=test bundle exec rake db:setup. Reason: exit status 1 

谢谢!

ruby-on-rails amazon-web-services aws-codebuild
1个回答
0
投票

显示的错误:

PG::ConnectionBad: could not connect to server: No such file or directory 
    Is the server running locally and accepting 
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? 

...看来您需要运行Postgresql数据库服务器的实例。我不确定您的应用程序如何使用数据库,但是尝试将Postgresql作为buildspec的一部分进行安装和启动;

要安装Postgresql(在'安装'阶段推荐)

- apt -y install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs

初始化并启动Postgresql(在'pre_build'阶段推荐)

- service postgresql initdb
- service postgresql start
© www.soinside.com 2019 - 2024. All rights reserved.