user2974739
user2974739

Reputation: 639

heroku reference file path

How do you reference a file when a ruby on rails application is deployed on Heroku? I'm using CURL::EASY and the cert parameter requires a path to the .p12 cert. This works on my local, but not when I deploy to heroku.

Upvotes: 1

Views: 2066

Answers (2)

glittershark
glittershark

Reputation: 544

What you're looking for is:

Rails.root.join('/path/to/cert')

However, committing a private certificate file to a code repository is very poor practice, for numerous security reasons. A much preferrable solution would be to store the certificate in a heroku config file using:

heroku config:set CERTIFICATE="your cert source here"

And then pass it to Curl::Easy using:

my_curl_easy.cacert = ENV['CERTIFICATE']   

Upvotes: 0

Selvamani
Selvamani

Reputation: 7684

try bash with your heroku

heroku run bash -a your-app-name

It will connect you the file directory. Type ls to view all files of your application.

Try more Gemfile.lock to view the code on your file.

Upvotes: 3

Related Questions