I want to achieve: Start Rails in EC2 production environment

This is my second month studying Ruby and Rails.

We are currently building an EC2 server.
After bundle install Unicorn

Edit database.yml

In EC2, execute the following command to reflect the contents of GitHub on EC2.

[ec2-user @ ip-***-**-**-***<repository name>] $git pull origin master

[ec2-user @ ip-***-**-**-***<repository name>] $rails db: create RAILS_ENV = production

When I execute, the following error occurs.

Could not find kgio-2.11.3 in any of the sources
Run `bundle install` to install missing gems.
Corresponding source code
group: production do
  gem'unicorn', '5.4.1'
<<: * default
  username: root
  password:<% = ENV ['DATABASE_PASSWORD']%>
  socket: /var/lib/mysql/mysql.sock
What I tried

I didn't have a question in the same situation as myself when I googled, so I haven't tried anything concrete yet.
I was wondering if I should install a gem called kgio, but when I checked the Ruby Gem documentation (https://rubygems.org/gems/kgio/versions/2.11.3), "kgio is Ruby2.3. I didn't know if I could install it because there was an explanation such as "It can only be used after that." .. ..

Supplementary information (FW/tool version, etc.)

Please provide more detailed information here.

If i have any missing information or conditions, I will add it, so please.
It's not enough words, but I would appreciate it if you could answer. Thank you.

  • Answer # 1

    git pullAfter$bundle installI think you need.

    $rails db: create RAILS_ENV = production

    In the argument of railsRAILS_ENV = productionThe method of passing is deprecated.
    -e productionOr$RAILS_ENV = production rails db: createYou will use either of them.

Related articles