Last active
June 24, 2019 19:33
-
-
Save Fitzsimmons/3aaab7e5718827f95dc4dfc6a00ef53a to your computer and use it in GitHub Desktop.
__FILE__ is set to the absolute path in Rails 5.2 when RAILS_ENV is set to production
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
justinf@jakiro:/tmp/runner_problem | |
> DISABLE_SPRING=1 RAILS_ENV=production bin/rails runner runner_test.rb | |
Rails version: 5.2.3 | |
Rails env: production | |
$0: runner_test.rb | |
__FILE__: /tmp/runner_problem/runner_test.rb | |
================================== | |
> DISABLE_SPRING=1 bin/rails runner -e production runner_test.rb | |
Rails version: 5.2.3 | |
Rails env: production | |
$0: runner_test.rb | |
__FILE__: runner_test.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "Rails version: #{Rails.version}" | |
puts "Rails env: #{Rails.env}" | |
puts "$0: #{$0}" | |
puts "__FILE__: #{__FILE__}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment