- Clone this application locally
- Install all dependencies with
bundle install
- Create the database
- Copy the
database.default.yml
todatabase.yml
- This is used locally by your server for your local environment
- Run
rake db:create
to create the database - Run
rake db:migrate
to create/ update all new and existing tables - Try running the app locally with
rails s
[Reference Heroku guide] (https://devcenter.heroku.com/articles/getting-started-with-rails5#rake)
- Login into heroku using the toolbelt -
heroku login
-
Email: schneems@example.com
Password:
Could not find an existing public key.
Would you like to generate one? [Yn]
Generating new SSH public key.
Uploading ssh public key /Users/adam/.ssh/id_rsa.pub```
- Create your application -
heroku create
-
https://infinite-scrubland-50119.herokuapp.com/ | https://git.heroku.com/infinite-scrubland-50119.git```
- Verify that the heroku remote is present (it works very much like git) -
git config --list | grep heroku
-
remote.heroku.fetch=+refs/heads/*:refs/remotes/heroku/*```
- Deploy your code -
git push heroku master
- If you are using the database in your application you need to manually migrate the database by running: -
heroku run rake db:migrate
- Any commands after the heroku run will be executed on a Heroku dyno. You can obtain an interactive shell session by running $ heroku run bash
- You’ve deployed your code to Heroku. You can now instruct Heroku to execute a process type. Heroku does this by running the associated command in a dyno, which is a lightweight container that is the basic unit of composition on Heroku. Let’s ensure we have one dyno running the web process type:
heroku ps:scale web=1
- You can check the state of the app’s dynos. The heroku ps command lists the running dynos of your application:
heroku ps
- Here, one dyno is running. We can now visit the app in our browser with
heroku open
- View the logs. If you run into any problems getting your app to perform properly, you will need to check the logs.
- You can view information about your running app using one of the logging commands,
heroku logs
- Let's visit the app on [heroku.com] (www.heroku.com)
- Create a user account
- Take a look at your database record for the users table, what do you see?
- Take a look at the user.rb script and compare it to how attributes are defined in the database, what is different?
- Now use sql to update the user_level to give yourself admin access
- Try using the rails_admin dashboard, where can you find the url path of the admin panel?