Bill Katz
2005-Aug-31 05:46 UTC
Gotcha in deploying Windows-edited files to Linux/lighttpd
I''m developing a Rails app on my WinXP server. When I tried to deploy it to a linux server, lighttpd started complaining about ":bad interpreter:" It took me some digging before I found the culprits, so just posting here to spare others a little time. The culprit is the dispatch.* file in /public. Obviously, the she-bang command needs to be modified to the linux equivalent. Less obvious was the /r/n to /n conversion needed. This did the trick: perl -i.win -npe ''s/\r\n/\n/g'' dispatch.* It renames the original files to dispatch.*.win and strips the characters that cause lighttpd to balk.
Frederic Jean
2005-Aug-31 21:39 UTC
Re: Gotcha in deploying Windows-edited files to Linux/lighttpd
Another option for the \r\n to \n conversion are the dos2unix and unix2dos commands. They work quite well in most situations. Frederic On 8/30/05, Bill Katz <billkatz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m developing a Rails app on my WinXP server. When I tried to deploy > it to a linux server, lighttpd started complaining about ":bad > interpreter:" It took me some digging before I found the culprits, so > just posting here to spare others a little time. > > The culprit is the dispatch.* file in /public. Obviously, the she-bang > command needs to be modified to the linux equivalent. Less obvious was > the /r/n to /n conversion needed. > > This did the trick: > perl -i.win -npe ''s/\r\n/\n/g'' dispatch.* > > It renames the original files to dispatch.*.win and strips the > characters that cause lighttpd to balk. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Frederic Jean fredjean-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org