Can't run 'rails console' on Elastic Beanstalk Amazon Linux 2

0

I'm working on upgrading a Rails 6 EB environment to Amazon Linux 2.

The app is working fine, but I'm having trouble running rails console on the environment.

Normally, I'd do something like this:

  • eb ssh
  • cd /var/app/current
  • sudo su
  • bundle exec rails c

But now, on Amazon Linux 2, it throws an error that my gems aren't installed. They seem to be installed in the vendor directory as part of the deployment, but bundler isn't recognising these.

To work around this, I have to manually run bundle install - which adds a couple of minutes whenever I have to run a console command.

Is there a solution to get this working again as easily as it did on Amazon Linux 1?

질문됨 2년 전1002회 조회
1개 답변
0
수락된 답변

The problem is that my application's environment variables are no longer set on the ec2-user when logging in.

There's a knowledge base article about how to get envvars loading by using an .ebextension file. This solves the problem.

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠