vim-i18n
vim-i18n copied to clipboard
The command is not available in this version: ruby << EOF
Hello,
I just made an update of vim-i18n and I have this error :
Erreur détectée en traitant /home/dougui/.dotfiles/.vim/bundle/vim-i18n/plugin/i18n.vim :
ligne 35 :
E319: The command is not available in this version: ruby << EOF
ligne 36 :
E492: Commande inconnue: require 'yaml'
ligne 38 :
E492: Commande inconnue: def get_translation(translation_key, file_name)
ligne 39 :
E492: Commande inconnue: locale = file_name.match(/(?<locale>\w+[-_]?\w+)\.yml$/)[:locale]
ligne 40 :
E492: Commande inconnue: translations_hash = load_yaml(file_name)
ligne 41 :
E492: Commande inconnue: translation = get_deep_value_for(translations_hash, "#{locale}.#{translation_key}")
ligne 42 :
E488: Caractères surnuméraires: print translation
ligne 43 :
E580: :endif sans :if: end
ligne 45 :
E492: Commande inconnue: def load_yaml(file_name)
ligne 46 :
E492: Commande inconnue: begin
ligne 47 :
E492: Commande inconnue: YAML.load(File.open(file_name))
ligne 48 :
E492: Commande inconnue: rescue
ligne 49 :
E492: Commande inconnue: raise "There's a problem with parsing translations from the file: #{file_name}"
ligne 50 :
E580: :endif sans :if: end
ligne 51 :
E580: :endif sans :if: end
ligne 53 :
E492: Commande inconnue: def get_deep_value_for(hash, key)
ligne 54 :
E133: :return en dehors d'une fonction
ligne 55 :
E488: Caractères surnuméraires
ligne 56 :
E163: Il n'y a qu'un seul fichier à éditer
ligne 57 :
E492: Commande inconnue: segment_tail_of_key = keys.join('.')
ligne 58 :
E492: Commande inconnue: value = hash[first_segment_of_key]
ligne 60 :
E133: :return en dehors d'une fonction
ligne 61 :
E492: Commande inconnue: get_deep_value_for(value, segment_tail_of_key)
ligne 62 :
E580: :endif sans :if: end
ligne 63 :
E492: Commande inconnue: EOF
ligne 35 :
E319: The command is not available in this version: ruby << EOF
ligne 36 :
E492: Commande inconnue: require 'yaml'
ligne 38 :
E492: Commande inconnue: def get_translation(translation_key, file_name)
ligne 39 :
E492: Commande inconnue: locale = file_name.match(/(?<locale>\w+[-_]?\w+)\.yml$/)[:locale]
ligne 40 :
E492: Commande inconnue: translations_hash = load_yaml(file_name)
ligne 41 :
E492: Commande inconnue: translation = get_deep_value_for(translations_hash, "#{locale}.#{translation_key}")
ligne 42 :
E488: Caractères surnuméraires: print translation
ligne 43 :
E580: :endif sans :if: end
ligne 45 :
E492: Commande inconnue: def load_yaml(file_name)
ligne 46 :
E492: Commande inconnue: begin
ligne 47 :
E492: Commande inconnue: YAML.load(File.open(file_name))
ligne 48 :
E492: Commande inconnue: rescue
ligne 49 :
E492: Commande inconnue: raise "There's a problem with parsing translations from the file: #{file_name}"
ligne 50 :
E580: :endif sans :if: end
ligne 51 :
E580: :endif sans :if: end
ligne 53 :
E492: Commande inconnue: def get_deep_value_for(hash, key)
ligne 54 :
E133: :return en dehors d'une fonction
ligne 55 :
E488: Caractères surnuméraires
ligne 56 :
E163: Il n'y a qu'un seul fichier à éditer
ligne 57 :
E492: Commande inconnue: segment_tail_of_key = keys.join('.')
ligne 58 :
E492: Commande inconnue: value = hash[first_segment_of_key]
ligne 60 :
E133: :return en dehors d'une fonction
ligne 61 :
E492: Commande inconnue: get_deep_value_for(value, segment_tail_of_key)
ligne 62 :
E580: :endif sans :if: end
ligne 63 :
E492: Commande inconnue: EOF
The error was not present before the update an hour ago.
Tanks!
Could you post what vim version you have? / Could you update vim & try once again? I use 7.4 and it seems to be build (I'm on mac osx). Also, I'm not sure what's your operating system. Could you check hints from this forum: http://stackoverflow.com/questions/3794895/installing-vim-with-ruby-support-ruby?
You seems to be right. This is because I use neovim. It seems to work with vim 7.4 on my system too. I'm under Linux Mint.
try running vim --version and see if you have ruby as an enabled feature. I'm running into the same issue and it looks like (at least on ubuntu 14.04LTS) the default vim (or the one you get by default through apt-get) doesn't have ruby enabled for scripting, which is what the file is trying to do. You may need to check what variants of vim your operating system supports. Hope this helps!
Ruby is enabled for vim but nvim is completely different. I think it's normal for nvim for the moment.
What about making this fail gracefully if Vim doesn't have Ruby support?
It seems Ruby is only required for function! I18nDisplayTranslation() so what about disabling this particular function if Ruby isn't present? Happy to work on a patch if you think it's a good idea.