0

I'm trying to deploy a Ruby on Rails app online using Elastic Beanstalk from AWS as part of a project. I'm using the AWS and EB CLI and I can run eb init without a problem. However, when I try to run eb create myproject-env it leads to this warning:

{DATE} ERROR [Instance: myInstance] Command failed on instance. Return code: 20 Output: (TRUNCATED)...dor/cache ']' + 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. You must use Bundler 2 or greater with this lockfile. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

I've tried googling the problem and I keep being lead back to this link, which makes sense as far as I can tell. The thing is, I can't figure out how to get past this error. I've tried making new IAM users and using --profile myProfile, I've changed the user in Command Prompt, and I've uninstalled and reinstalled Bundler, awscli, and awsebcli. I'd like to keep this in the CLI just because I want to be able to use eb deploy in the future. And I can run the app locally using Puma with no problem, so I feel like I just haven't configured something correctly with AWS.

I also can't figure out the error about using a version of Bundler 2 or higher, because I am using a higher version on my computer right now.

I'm using Rails 5.2.2, Ruby 2.4.4, and Bundler 2.0.1 and I'm using Windows Command Prompt.

Any help would be appreciated!

B. Kim
  • 1
  • 1
  • 1
  • Looks like you need to tell Elastic Beanstalk the version of `bundler` you want. Check [this answer](https://stackoverflow.com/questions/30240973/elastic-beanstalk-bundler-could-not-find-compatible-versions-for-gem-bundler#answer-30243577) out. The answer is a little old, so ensure you specify the right version of `bundler` to install. – progfan Mar 07 '19 at 20:57
  • I did something similar to this based on another answer, actually, but I ultimately had to install Ubuntu because Command Terminal kept treating me as the root user. Thank you so much for your response, though! – B. Kim Mar 09 '19 at 06:57

0 Answers0