How can I use Rails 5.2 credentials in capistrano's deploy.rb file? : <p>I've just updated my Rails app to 5.2, and configured it to use the new <code>config/credentials.yml.enc</code> file.</p>

<p>When I try to deploy, I get this error:</p>

<pre><code>NameError: uninitialized constant Rails
/Users/me/Documents/project/config/deploy.rb:27:in `&lt;top (required)&gt;'
</code></pre>

<p>That's pointing to this line in my <code>config/deploy.rb</code> file:</p>

<pre><code>set :rollbar_token, Rails.application.credentials[:rollbar_token]
</code></pre>

<p>So it appears that while capistrano is running, it doesn't have access to <code>Rails.application.credentials</code>.</p>

<p>How are you all handling this? I've got some ideas...</p>

<ul>
<li>Set this one variable as an <code>ENV</code> variable

<ul>
<li>I don't love how this separates/customizes this one setting</li>
</ul></li>
<li>Somehow make it so capistrano has access to <code>Rails.application.credentials</code>

<ul>
<li>I don't know if this is a good idea or if there are other things I need to be aware of if I go this route</li>
</ul></li>
<li>Remove deploy tracking in rollbar

<ul>
<li>🤷‍♂️</li>
</ul></li>
</ul>
