Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.6, JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Application Error
-
Labels:None
-
Environment:jruby 1.6.6, rails-3.1.1, execjs 1.2.9
-
Number of attachments :
Description
I'm seeing behavior extremely similar to JRUBY-5942 in jruby-1.6.6. Running rake assets:precompile works fine in jruby-1.6.5, but in 1.6.6 I get:
rake aborted! can't convert Encoding into String (in /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/haml_coffee_assets-0.6.0/vendor/assets/javascripts/hamlcoffee.js.coffee.erb) org/jruby/RubyIO.java:3722:in `popen' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:165:in `sh' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:125:in `exec_runtime' org/jruby/RubyBasicObject.java:1700:in `__send__' org/jruby/RubyKernel.java:2099:in `send' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:27:in `exec' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:40:in `compile_to_tempfile' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:26:in `exec' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:18:in `eval' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/execjs-1.2.9/lib/execjs/external_runtime.rb:32:in `call' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/coffee-script-2.2.0/lib/coffee_script.rb:57:in `compile' /home/ubuntu/.rvm/gems/jruby-1.6.6@circle/gems/tilt-1.3.3/lib/tilt/coffee.rb:46:in `evaluate'
the code in question is
def sh(command)
output, options = nil, {}
options[:external_encoding] = @encoding if @encoding
options[:internal_encoding] = Encoding.default_internal || 'UTF-8'
IO.popen(command, options) { |f| output = f.read }
output
end
Looks like you have Encoding.default_internal being non-nil, and JRuby is not handing it correctly inside IO.popen.
What is your default internal encoding? Does passing -U to jruby help you?