0
0
Ruby on Railsframework~10 mins

Heroku deployment in Ruby on Rails - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new Heroku app using the CLI.

Ruby on Rails
heroku [1] myapp
Drag options to blanks, or click blank then click option'
Astart
Bcreate
Cdeploy
Dinit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deploy' instead of 'create' will cause an error.
Using 'start' or 'init' are not valid Heroku commands.
2fill in blank
medium

Complete the command to push your Rails app code to Heroku.

Ruby on Rails
git push [1] main
Drag options to blanks, or click blank then click option'
Aorigin
Bmaster
Cheroku
Ddeploy
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'origin' pushes to GitHub, not Heroku.
Using 'master' is a branch name, not a remote.
3fill in blank
hard

Fix the error in the command to run database migrations on Heroku.

Ruby on Rails
heroku run [1] db:migrate
Drag options to blanks, or click blank then click option'
Arake
Bgem
Cbundle
Drails
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'rake' may work in older Rails but is deprecated.
Using 'bundle' or 'gem' are not commands to run migrations.
4fill in blank
hard

Fill both blanks to set the Ruby version and Rails environment in the Heroku app config.

Ruby on Rails
heroku config:set RUBY_VERSION=[1] RAILS_ENV=[2]
Drag options to blanks, or click blank then click option'
A3.2.2
Bproduction
Cdevelopment
D2.7.0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting Rails environment to 'development' will not run production settings.
Using an old Ruby version may cause compatibility issues.
5fill in blank
hard

Fill all three blanks to define a Procfile that runs the Rails server on the correct port.

Ruby on Rails
web: bundle exec [1] server -p [2] -e [3]
Drag options to blanks, or click blank then click option'
Arails
B$PORT
Cproduction
Dpuma
Attempts:
3 left
💡 Hint
Common Mistakes
Hardcoding the port instead of using $PORT causes errors.
Using 'puma' directly without 'rails' may not work as expected.