У меня есть проект rails, который я пытаюсь создать с помощью AWS codedeploy, и у меня есть некоторые проблемы с указанием версии ruby. Используя AWS codedeploy стандартного образа (aws / codebuild / standard: 2.0). Я также попытался построить, в котором я поместил «runtime-versions: ruby: 2.6.3» в buildspe c, но это привело к следующей ошибке: «Код состояния контекста фазы: YAML_FILE_ERROR Сообщение: неизвестная версия среды выполнения с именем '2.6. 3 'из ruby. Этот образ сборки имеет следующие версии: 2.6 "
Вот ошибка, которую я получаю при сборке:
[Container] 2020/05/04 19:02:30 Waiting for agent ping
[Container] 2020/05/04 19:02:32 Waiting for DOWNLOAD_SOURCE
[Container] 2020/05/04 19:02:34 Phase is DOWNLOAD_SOURCE
[Container] 2020/05/04 19:02:34 CODEBUILD_SRC_DIR=/codebuild/output/src627814628/src/git-codecommit.us-east-2.amazonaws.com/v1/repos/floppyhats
[Container] 2020/05/04 19:02:34 YAML location is /codebuild/output/src627814628/src/git-codecommit.us-east-2.amazonaws.com/v1/repos/floppyhats/buildspec.yml
[Container] 2020/05/04 19:02:34 Processing environment variables
[Container] 2020/05/04 19:02:34 Selecting 'ruby' runtime version '2.6' based on manual selections...
[Container] 2020/05/04 19:02:34 Running command echo "Installing Ruby version 2.6 ..."
Installing Ruby version 2.6 ...
[Container] 2020/05/04 19:02:34 Running command rbenv global $RUBY_26_VERSION
[Container] 2020/05/04 19:02:34 Moving to directory /codebuild/output/src627814628/src/git-codecommit.us-east-2.amazonaws.com/v1/repos/floppyhats
[Container] 2020/05/04 19:02:34 Registering with agent
[Container] 2020/05/04 19:02:34 Phases found in YAML: 3
[Container] 2020/05/04 19:02:34 INSTALL: 3 commands
[Container] 2020/05/04 19:02:34 PRE_BUILD: 3 commands
[Container] 2020/05/04 19:02:34 BUILD: 2 commands
[Container] 2020/05/04 19:02:34 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED
[Container] 2020/05/04 19:02:34 Phase context status code: Message:
[Container] 2020/05/04 19:02:34 Entering phase INSTALL
[Container] 2020/05/04 19:02:34 Running command echo Installing Bundler...
Installing Bundler...
[Container] 2020/05/04 19:02:34 Running command gem install bundler
rbenv: version `ruby-2.6.3' is not installed (set by /codebuild/output/src627814628/src/git-codecommit.us-east-2.amazonaws.com/v1/repos/floppyhats/.ruby-version)
[Container] 2020/05/04 19:02:34 Command did not exit successfully gem install bundler exit status 1
[Container] 2020/05/04 19:02:34 Phase complete: INSTALL State: FAILED
[Container] 2020/05/04 19:02:34 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: gem install bundler. Reason: exit status 1
Вот мой файл buildspe c :
version: 0.2
phases:
install:
runtime-versions:
ruby: 2.6
commands:
- echo Installing Bundler...
- gem install bundler
- bundle install
pre_build:
commands:
- echo Preparing database to run tests...
- RAILS_ENV=test rails db:setup
- RAILS_ENV=test rails db:migrate
build:
commands:
- echo Running tests...
- rails test
И соответствующий кусок моего гемфайла
source 'https://rubygems.org'
ruby '2.6.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.2'
Спасибо за помощь!