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

后端 未结 11 1107
一整个雨季
一整个雨季 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:22

    add an eb extension shortcut:

    # .ebextensions/irb.config
    files:
      "/home/ec2-user/irb":
        mode: "000777"
        owner: root
        group: root
        content: |
          sudo su - -c 'cd /var/app/current; bundle exec rails c'
    

    then:

    $ eb ssh
    $ ./irb
    irb(main):001:0>
    

提交回复
热议问题