DEV Community

Pritam Pramanik
Pritam Pramanik

Posted on

How to run rails console on elastic beanstalk rails app

  1. Put all you environment variable into .env file root of your project directory.
sudo su - -c "cd /var/app/current; /opt/elasticbeanstalk/bin/get-config --output YAML environment | sed 's/: /=/g' > .env"
Enter fullscreen mode Exit fullscreen mode
  1. Set environment variable from .env file
export $(grep -v '^#' .env | xargs -d '\n')
Enter fullscreen mode Exit fullscreen mode
  1. Run your rails console based rails environment(production/staging/test/development etc).
RAILS_ENV=production bundle exec rails c
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay