5

When deploying on Heroku, the server crashes with this information rails server syntax error File.expand_path("../spring", FILE) though everything is working when working locally. Here is my rail file

begin
  load File.expand_path("../spring", __FILE__)
rescue LoadError
end
APP_PATH=File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'

Do you have any idea of the issue? Thanks

Baldrick
  • 23,882
  • 6
  • 74
  • 79
fro
  • 437
  • 4
  • 16

1 Answers1

7

Found the solution after 1/2 day of struggling You need the following line at the top of the rail file: #!/usr/bin/env ruby Surprisingly, it wasn't a problem locally but when deploying on Heroku it was.

fro
  • 437
  • 4
  • 16
  • 2
    Thank you. That was obnoxious as hell. Got the simplecov gem and placed some lines above the line you mention above. Moving `#!/usr/bin/env ruby.exe` back to the top made everything work out. – Jon La Marr May 14 '15 at 20:29