Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2|
Lessons:- Deploying to Production with SSL

To get the deployment to work, we first need to add a line forcing the use of SSL in production. The result, which involves editing the production configuration file config/environments/production.rb, appears in Listing 7.28.

 

 

To get the production site working, we have to commit the change to the configuration file and push the result up to Heroku:

$   git commit -a -m   "Add SSL in production"
$   git push heroku

 

Next, we need to run the migration on the production database to tell Heroku about the User data model:13 

$ heroku run rake db:migrate

 

(You might see some deprecation warnings at this point, which you should ignore.)

Finally, we need to set up SSL on the remote server. Configuring a production site to use SSL is painful and error-prone, and among other things it involves purchasing an SSL certificate for your domain. Luckily, for an application running on a Heroku domain (such as the sample application), we can piggyback on Heroku’s SSL certificate, a feature that is included automatically as part of the Heroku platform. If you want to run SSL on a custom domain, such as example.com, you’ll have no choice but to endure some pain, which you can read about on Heroku’s page on SSL.

                    The result of all this work is a working signup form on the production server (Figure 7.22):  

heroku  open

 

Note in Figure 7.22 the https:// in place of the usual http://. The extra ‘‘s’’ is an indication that SSL is working. You should feel free to visit the signup page and create a new user at this time. If you have trouble, try running

$  heroku  logs  

to debug the error using the Heroku logfile.

 

 

 
 
 
image
Pooja   Negi

Skills    Ruby On Rails

Qualifications :- High School - SSN high school, College/University - HNBGU, College/University - SRHU,
Location :-Ranipokhari,Rishikesh,Uttarakhand,India
Description:- Student
Explore
 

  Students (0)