Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku deployment crash rails server syntax error File.expand_path("../spring", __FILE__)

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

like image 455
fro Avatar asked Jun 17 '14 23:06

fro


1 Answers

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.

like image 177
fro Avatar answered Oct 06 '22 00:10

fro