首页 > 解决方案 > 安装 SASSC gem 时出现 AWS Codebuild 错误 ruby​​ 版本错误

问题描述

我正在运行一个 Codestar 项目。示例应用程序安装良好。当我使用 SASSC 添加我的应用程序时,由于 Ruby 版本而失败。有没有通知 CodeBuild 升级 Ruby 版本?尝试查看 buildspec.yml 我在附近吗?试图谷歌。

在构建日志中间

Installing sassc 2.0.0 with native extensions
 Gem::InstallError: sassc requires Ruby version >= 2.3.3.

在构建日志结束时

An error occurred while installing sassc (2.0.0), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.0.0'` succeeds before bundling.
 [Container] 2018/12/31 04:17:42 Command did not exit successfully bundle install exit status 5
[Container] 2018/12/31 04:17:42 Phase complete: INSTALL Success: false
[Container] 2018/12/31 04:17:42 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: bundle install. Reason: exit status 5

谢谢。

标签: ruby-on-railsrubyamazon-web-servicesaws-codebuildaws-codestar

解决方案


我使用 Ruby 2.5.3 将 Codebuild 环境从 AWS Linux 发行版更改为 Ubuntu,这解决了我的问题。除非有人有更好的答案。


推荐阅读