Can you run a rails console or rake command in the elastic beanstalk environment?

后端 未结 11 1082
一整个雨季
一整个雨季 2020-12-12 21:03

I have set up a RoR environement on AWS\' elastic beanstalk. I am able to ssh into my EC2 instance. My home directory is /home/ec2-user, which is effective

11条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 21:15

    I like to create an eb_console file at the root of my rails app, then chmod u+x it. It contains the following:

    ssh -t ec2-user@YOUR_EC2_STATION.compute.amazonaws.com  'cd /var/app/current && bin/rails c'
    

    This way, I just have to run:

    ./eb_console
    

    like I would have run heroku run bundle exec rails c.

提交回复
热议问题