tenderlove/psych — Issue #48: Psych dies installing some gems with jruby, special characters are not allowed
Author: alexblakemore
Created: 2012-02-18 19:40:05+00:00
State: open

This looks like a Psych problem and not a jruby or gem author problem, but its hard to tell.

The command "jruby --1.9 -s gem install" fails on a few gems and gives a stack trace showing PsychParser.java threw an exception. The current versions of the adauth and will_paginate gems both cause the behavior, stack trace shown below.

Using "jruby --1.8" which apparently does not use the Psych YAML parser, works fine as a workaround.

bash-3.1$ jruby --1.9 -S gem install adauth
Fetching: net-ldap-0.3.1.gem (100%)
Psych::SyntaxError: special characters are not allowed
parse at org/jruby/ext/psych/PsychParser.java:282
parse_stream at c:/jruby-1.6.6/lib/ruby/1.9/psych.rb:148
parse at c:/jruby-1.6.6/lib/ruby/1.9/psych.rb:119
load at c:/jruby-1.6.6/lib/ruby/1.9/psych.rb:106
from_yaml at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/specification.rb:490
load_gemspec at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:195
initialize at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:60
each at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:64
loop at org/jruby/RubyKernel.java:1408
each at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:55
initialize at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:35
open at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:20
open at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/package.rb:44
from_io at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/format.rb:62
from_file_by_path at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/format.rb:46
open at org/jruby/RubyIO.java:1139
open at org/jruby/RubyKernel.java:297
from_file_by_path at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/format.rb:45
format at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/installer.rb:119
spec at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/installer.rb:129
ensure_required_ruby_version_met at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/installer.rb:386
install at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/installer.rb:156
install at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:297
each at org/jruby/RubyArray.java:1614
each_with_index at org/jruby/RubyEnumerable.java:956
install at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:270
execute at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:121
each at org/jruby/RubyArray.java:1614
execute at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115
invoke at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/command.rb:278
process_args at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:147
run at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:117
run at c:/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:65
(root) at c:/jruby-1.6.6/bin/gem:21

bash-3.1$ jruby -v
jruby 1.6.6 (ruby-1.9.2-p312) (2012-01-30 5673572) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_23) [Windows 7-amd64-java]