ruby on rails - `/usr/bin/file -i SOME_FILE` returns different result when deployed to Phusion Passenger -


i'm using /usr/bin/file -i some_file detect whether contains non-ascii-and-utf characters. however, produces different result when application deployed apache+passenger.

in 'script/console', above line gives: some_file: text/plain; charset=utf-8

in passenger, gives:

some_file: regular file

since pointing absolute path of 'file', strange. i'm guessing library used different in passenger. comments?

if not right way detect text file's encoding, best approach(in ruby)?

thank much.

i'm guessing difference between versions of 'file' utility between development machine , server. have tried running them terminal of both machines?


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -