rails / sass-rails

Ruby on Rails stylesheet engine for Sass
MIT License
859 stars 333 forks source link

Installation fails on Windows/Jruby 9.3.9.0 #449

Open TheSynthMaster opened 2 years ago

TheSynthMaster commented 2 years ago

Trying to upgrade from rails 5 to a new installation, installed jruby last version 9.3.9.0 and trying to

gem install sass-rails

returns

C:\asset\applications\asestero_new>gem install sass-rails Building native extensions. This could take a while... ERROR: Error installing sass-rails: ERROR: Failed to build gem native extension.

current directory: C:/asset/jruby-9.3.9.0/lib/ruby/gems/shared/gems/sassc-2.

4.0/ext C:/asset/jruby-9.3.9.0/bin/jruby.exe -I C:/asset/jruby-9.3.9.0/lib/ruby/stdlib - r ./siteconf20221110-8908-oh7pcn.rb extconf.rb creating Makefile

current directory: C:/asset/jruby-9.3.9.0/lib/ruby/gems/shared/gems/sassc-2.4.0/ ext make DESTDIR\= clean current directory: C:/asset/jruby-9.3.9.0/lib/ruby/gems/shared/gems/sassc-2.4.0/ ext make DESTDIR\= make failedCannot run program "make" (in directory "C:\asset\jruby-9.3.9.0\lib\r uby\gems\shared\gems\sassc-2.4.0\ext"): CreateProcess error=2, The system cannot find the file specified

Gem files will remain installed in C:/asset/jruby-9.3.9.0/lib/ruby/gems/shared/g ems/sassc-2.4.0 for inspection. Results logged to C:/asset/jruby-9.3.9.0/lib/ruby/gems/shared/extensions/univers al-java-1.8/2.6.0/sassc-2.4.0/gem_make.out

TheSynthMaster commented 2 years ago

The problem is the requirement of sassc-rails, if I delete that requirement the gem is installed (but it does not work because it still requires sassc for some reason). I have version 5.0.6 and it does not require sassc. That was introduced in 6.0.0 beta 2 (why? jruby was forgotten?)

ahorek commented 1 year ago

SassC requires a C compiler.

install a devkit https://rubyinstaller.org/downloads/ run ridk enable jruby -S gem install sassc

this way you should be able to install and use the gem on JRuby + Windows. see https://github.com/sass/sassc-ruby/issues/182

there are ways that could improve the situation and remove the requirement, but it's unlikely to ever happen since the gem isn't maintained anymore.