I finished building a website and want to deploy it to Digital Ocean VPN. Installed Capistrano and Passenger. During initial deployment I was receiving an error that apparen
I encountered the exactly same error message. With that telltale, I googled "check if a file is valid utf-8" and found isutf8(1): check whether files are valid UTF-8 - Linux man page. So I installed isutf8 and then ran the following command from the Rails root on my linux machine
isutf8 `find app`
Although there are lots of noise in the output, it tells me that app/assets/javascripts/filterbar.js: line 1, char 1, byte offset 41: invalid UTF-8 code
. So I opened that file. Viola! I saw a few garbled characters. Once I removed those characters, my rake assets:precompile
succeeded. The actual guilty file of yours might be different, of course. You can also use other utility to check utf-8 such as in this stackoverflow question on utf-8, of course.