Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Psych::SyntaxError: (<unknown>): 'reader' unacceptable character '' (0x1B) #161

Closed
ivanxuu opened this issue Jul 30, 2015 · 0 comments
Closed
Labels
Milestone

Comments

@ivanxuu
Copy link

ivanxuu commented Jul 30, 2015

In a jRuby rails app working fine with i18n-tasks v0.8.4, now I've upgraded to v0.8.5 I'm getting this error (full backtrace):

ivan@z11:~/Development/touristed (devel)$ i18n-tasks 
Psych::SyntaxError: (<unknown>): 'reader' unacceptable character '�' (0x1B) special characters are not allowed
in "'reader'", position 755 at line 0 column 0
                 parse at org/jruby/ext/psych/PsychParser.java:219
          parse_stream at /home/ivan/.rvm/rubies/jruby-9.0.0.0.pre1/lib/ruby/stdlib/psych.rb:370
                 parse at /home/ivan/.rvm/rubies/jruby-9.0.0.0.pre1/lib/ruby/stdlib/psych.rb:318
                  load at /home/ivan/.rvm/rubies/jruby-9.0.0.0.pre1/lib/ruby/stdlib/psych.rb:245
           file_config at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/configuration.rb:16
               config= at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/configuration.rb:30
            initialize at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/base_task.rb:38
             base_task at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:58
              commands at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:48
      commands_summary at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:136
  optparse_no_command! at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:98
            initialize at /home/ivan/.rvm/rubies/jruby-9.0.0.0.pre1/lib/ruby/stdlib/optparse.rb:917
  optparse_no_command! at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:92
             optparse! at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:72
                parse! at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:63
                   run at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:38
                 start at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:18
  auto_output_coloring at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:199
                 start at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:16
                 start at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/lib/i18n/tasks/cli.rb:9
                (root) at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/gems/i18n-tasks-0.8.5/bin/i18n-tasks:13
                  load at org/jruby/RubyKernel.java:969
                (root) at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/bin/i18n-tasks:1
                  eval at org/jruby/RubyKernel.java:990
                (root) at /home/ivan/.rvm/gems/jruby-9.0.0.0.pre1@touristed/bin/i18n-tasks:23

It works fine in MRI with v0.8.5, and also in any ruby version if using previous v0.8.4 version. So reverting to the v0.8.4 version of the gem it will work fine.

The problem appears when parsing the configuration file config/i18n-tasks.yml by i18n-tasks-0.8.5/lib/i18n/tasks/configuration.rb:16. In i18n-tasks.yml, the line which appears by default:
# - "<%= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"
will be rendered in my system to:
# - \"\e[31mCould not find gem 'vagrant'.\e[0m/templates/locales/%{locale}.yml\"\n\n
which causes the problem, so I can remove that line from the i18n-tasks.yml file to make the problem dissapear.

@glebm glebm added the bug label Jul 30, 2015
@glebm glebm added this to the v0.8.6 milestone Jul 30, 2015
@glebm glebm closed this as completed in f86b9b7 Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants