-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using ruby 2.6+ with jekyll/bundler #2565
Comments
Hi 👋, thanks for opening! While we look into this... If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions. Lastly, please make sure you've specified the |
Hi @daxenberger 👋🏽 thank you for raising this issue. We are investigating this and I will report back with an update. |
Any updates on this one? The issue persists ... |
Any updates? I'm also going down this road where I need Ruby 2.7.x to support Jekyll 4.x. I tried using a custom build image based on Ubuntu. I was able to successfully build my site in a local docker container running my custom image. root@d1a946cccbe6:/working/mysite_repo# 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.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching public_suffix 5.0.0
Installing public_suffix 5.0.0
Fetching addressable 2.8.1
Installing addressable 2.8.1
Using bundler 2.1.4
...
Bundle complete! 8 Gemfile dependencies, 35 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed. But when I run it in AWS Amplify, it fails with this message: # Starting phase: preBuild
2022-10-14T03:47:37.362Z [INFO]: # Executing command: bundle install
2022-10-14T03:47:37.362Z [WARNING]: /codebuild/output/src390886491/src/mysite_repo/amplify.sh: line 13: bundle: command not found
2022-10-14T03:47:37.362Z [ERROR]: !!! Build failed
2022-10-14T03:47:37.362Z [ERROR]: !!! Non-Zero Exit Code detected
2022-10-14T03:47:37.363Z [INFO]: # Starting environment caching...
2022-10-14T03:47:37.363Z [INFO]: # Environment caching completed
Terminating logging... Any ideas why? |
I may have found an answer. I modified my build's In the future, to upgrade to a later ruby version, I can either rebuild the image, or add the command to install the latest ruby version in the version: 1
env:
variables:
JEKYLL_ENV: production
frontend:
phases:
preBuild:
commands:
- eval "$(/root/.rbenv/bin/rbenv init - bash)"
- rbenv global 2.7.1
- gem install bundler
- bundle install
build:
commands:
- bundle exec jekyll build
artifacts:
baseDirectory: _site
files:
- '**/*'
cache:
paths: [] |
Hi @hloriana , I am having the same issue trying to build my Jekyll website with AWS Amplify. It seems the build container is set up to use Ruby v2.6.3, but I need Ruby version 2.7.x or higher. I tried using @RockManJoe64 's solution, but the build log gives me a How can I set up the build environment to use a more recent version of Ruby? |
Hey @EdjeElectronics so the yaml prebuild commands in my post only work with a custom build image I made. If you're using the base Amplify image then it won't work 😁 |
Got it, thanks @RockManJoe64 ! I got the build to work by adding
|
Hi everyone 👋 , Amplify Hosting now uses the Amazon Linux 2023 build image by default for newly deployed applications and it has ruby version 3.2.2 and jekyll version 4.3.2 installed with it. For steps on how to update the build image for existing apps from Amazon Linux 2 to Amazon Linux 2023 refer to this blog post: https://aws.amazon.com/blogs/mobile/amazon-linux-2023-hosting/. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
This issue has been automatically locked. |
Please describe which feature you have a question about?
I am building a static website with a jekyll version that requires ruby 2.5+, but I haven't found a way to do so using the (default) linux:2 build image. Even though I explicitly specified the ruby version in the
Gemfile
, I only seeI also tried setting
VERSION_RUBY_DEFAULT
in the pre-build settings without effect.Provide additional details
The only way I managed to make it work was to set a custom build image. However, using a
jekyll/builder
image doesn't work at all (deployment fails at the Build step without any logs available), so I have to use the plainruby
image with a suitable version andgem install bundler jekyll
in the pre-build settings at every build. This works, but significantly increases build time, so not really a satisfying solution.What AWS Services are you utilizing?
Only working on the Amplify console.
Provide additional details e.g. code snippets
See above.
The text was updated successfully, but these errors were encountered: