1

Calling bash command

cmd = '/usr/bin/mediainfo "/var/avalon/dropbox/Лекции_для_молодых_ученых/Nabiullin_SciERes_1.flv" --Output=XML'    
out = `#{cmd}`

In rails project 'avalom media system' return error code 1.

Removal of russian letters out of the path cmd = '/usr/bin/mediainfo "/var/avalon/dropbox/Nabiullin_SciERes_1.flv" --Output=XML' , a call to another command cmd = 'head "/var/avalon/dropbox/Лекции_для_молодых_ученых/Nabiullin_SciERes_1.flv"' or run the command in irb or project environment or bash - everything is fine.

Thx.

Error when i try add media file to collection with russian letters in file:543 => in gem media info file:473

Console encoding - utf-8. Command string encoding - utf-8.

  • What is your question? – sawa Feb 02 '15 at 04:48
  • How to run this command? – shadeofpast Feb 02 '15 at 04:55
  • I described the problem. And it is obvious that I want to solve it. And the question is how to do it and what is the cause of this problem? – shadeofpast Feb 02 '15 at 05:10
  • Is calling the command directly from bash prompt executed successfully? – Aleksei Matiushkin Feb 02 '15 at 05:55
  • Yes, it is. _or run the command in irb or project environment or bash - everything is fine._ – shadeofpast Feb 02 '15 at 05:59
  • What produces the text `Removal of russian letters out of the path`? It's difficult to tell if this is output from `avalon`, your own project, or a comment by you. – Ken Y-N Feb 02 '15 at 06:31
  • its moderator editions. i means that if command didnt contain russian litters that command return 0. same if run it from bash or irb etc. sorry for my eng.( – shadeofpast Feb 02 '15 at 06:34
  • I setup avalon. Try to fill it with my sample. When add media file to collection catch error (italic in main post). And now I try understand what is the cause of this problem? – shadeofpast Feb 02 '15 at 06:43
  • Okey. New quest =) I saved path to file path.tmp (utf-8). Run this command ``"/usr/bin/mediainfo `head /var/avalon/dropbox/path.tmp` --Output=XML"`` from bash - return ok. run this command in avalon instead of create mediainfo object - return faild (1). run this command from rails console in avalon environment - return ok. – shadeofpast Feb 02 '15 at 06:48
  • `ENV["LANG"]` from rails console in avalon environment = `"en_US.UTF-8"`, from avalon's master_file.rb `"C"`. Mb this is key? – shadeofpast Feb 02 '15 at 06:53

1 Answers1

0

The cause of this problem is that ENV["LANG"] of avalon is C. Set ENV["LANG"] to en_US.utf-8 resolve this trouble.