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

sassc-rails not working with jruby 9k #92

Closed
gkosmr opened this issue Jun 12, 2017 · 1 comment
Closed

sassc-rails not working with jruby 9k #92

gkosmr opened this issue Jun 12, 2017 · 1 comment

Comments

@gkosmr
Copy link

gkosmr commented Jun 12, 2017

I tried to precompile assets with jruby9 and got the error below.
It works fine with version 1.2.1 of sassc-rails. As the stacktrace indicates the problem is in template.rb when calling safe_merge (which was introduced in version 1.3.0) in a block passed to Hash#merge.

It works fine with ruby (tested with 2.3.0 and 2.4.1).

Using hsh1.merge(hsh2) { |*args| fn(*args) } does not work in jruby, while it does in ruby. On the other hand hsh1.merge(hsh2){ |args| fn(*args) } works in jruby but not in ruby.

Since we know exactly what is passed to block in merge function, i suggest calls to safe_merge are changed to: hsh1.merge(hsh2){ |key, left, right| sage_merge(key, left, right) }.

I can prepare the pull request, if you agree with the change.

Stacktrace:

rake aborted!
ArgumentError: wrong number of arguments (1 for 3)
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sassc-rails-1.3.0/lib/sassc/rails/template.rb:29:in safe_merge' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sassc-rails-1.3.0/lib/sassc/rails/template.rb:29:in block in call'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sassc-rails-1.3.0/lib/sassc/rails/template.rb:18:in call' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/sass_processor.rb:30:in call'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in call_processor' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in block in call_processors'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in call_processors' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in load_from_unloaded'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in block in load' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in fetch_asset_from_dependency_cache'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in load' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in block in initialize'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in load' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/bundle.rb:23:in block in call'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/utils.rb:200:in dfs' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/bundle.rb:24:in call'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in call_processor' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in block in call_processors'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in call_processors' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in load_from_unloaded'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in block in load' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in fetch_asset_from_dependency_cache'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in load' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in block in initialize'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in load' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in find_asset'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in find_all_linked_assets' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:134:in block in find'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:133:in find' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in compile'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in block in define' /home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in with_logger'
/home/gasper/.rvm/gems/jruby-9.0.5.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in block in define' /home/gasper/.rvm/gems/jruby-9.0.5.0@global/gems/rake-12.0.0/exe/rake:27:in '
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

@glebm
Copy link
Contributor

glebm commented Oct 2, 2018

This is likely caused by jruby/jruby#4108 or one of the related issues, and unlikely to be fixed soon on the JRuby side.

I agree that this should be worked around here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants