【发布时间】:2018-02-04 01:34:29
【问题描述】:
我正在尝试将 ruby 应用程序部署到 codedeploy 并且当它安装 Sinatra 时,它一直给我一个错误,它需要更高版本的 ruby 然后安装在服务器上。如何指定要使用的版本?
我在我的 Gemfile 中指定了它,在 appspecfile 中尝试了几种方法
LifecycleEvent - BeforeInstall
Script - scripts/install_dependencies
[stdout]Successfully installed bundler-1.15.4
[stdout]Parsing documentation for bundler-1.15.4
[stdout]Done installing documentation for bundler after 5 seconds
[stdout]1 gem installed
[stdout]Updating installed gems
[stdout]Nothing to update
[stderr]ERROR: Error installing sinatra:
[stderr] rack requires Ruby version >= 2.2.2.
我已经在我的 appspec.yml 文件中尝试过这个
language: ruby
rvm:
- 2.4.1
- jruby-head
Before_install: # For jruby-head to work.
- gem install bundler
- gem update bundler
任何形式的帮助都会很棒,谢谢
这是我在尝试上面找到的之前的 appspec.yml 版本
version: 0.0
os: linux
files:
- source: /.
destination: /var/www/html/
hooks:
BeforeInstall:
- location: scripts/install_dependencies
timeout: 300
runas: root
- location: app.rb
timeout: 300
runas: root
ApplicationStop:
- location: app.rb
timeout: 300
runas: root
ApplicationStart:
- location: app.rb
timeout: 300
runas: root
宝石文件
source 'https://rubygems.org'
ruby "~> 2.3.0"
gem 'sinatra', '2.0.0'
【问题讨论】:
标签: ruby amazon-web-services yaml aws-code-deploy