Created
December 22, 2011 14:18
-
-
Save ebouchut/1510447 to your computer and use it in GitHub Desktop.
(Sass/maven) Unable to launch rake using jruby-rake-plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar ~/.m2/repository/org/jruby/jruby-complete/1.6.5/jruby-complete-1.6.5.jar -S gem env |
How to configure the GEM path: http://forums.site5.com/showthread.php?t=11954
The workaround is to use the second to last version (1.5.6) instead of the latest (1.6.5).
Version 1.5.6 contains rake.
Version 1.6.5 ... does not!
<!-- Excerpt of working pom.xml (at least) -->
<properties>
<jruby.version>1.5.6</jruby.version>
<gem.home>${user.home}/.gem/jruby/1.8</gem.home>
<gem.options>--no-rdoc --no-ri --no-test</gem.options>
</properties>
<plugins>
<plugin>
<groupId>org.jruby.plugins</groupId>
<artifactId>jruby-rake-plugin</artifactId>
<version>${jruby.version}</version>
<executions>
<execution>
<id>install-sass</id>
<phase>process-resources</phase>
<goals>
<goal>jruby</goal>
</goals>
<configuration>
<args>-S gem install -i ${gem.home} ${gem.options} sass</args>
</configuration>
</execution>
<execution>
<id>sass</id>
<phase>process-resources</phase>
<goals>
<goal>jruby</goal>
</goals>
<configuration>
<args>-I${gem.home} -S sassify.rb ${basedir}/src/main/webapp/sass ${basedir}/src/main/webapp/css</args>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Here is the ruby file (sassify.rb) maven is calling to transform SASS into CSS:
require 'rubygems'
require 'sass'
require 'sass/exec'
abort "2 arguments required: source_dir destination_dir" if ARGV.size != 2
source_dir = ARGV[0]
dest_dir = ARGV[1]
options = [
"--update",
"--no-cache",
"--style", "expanded",
"#{source_dir}:#{dest_dir}"
]
sass = Sass::Exec::Sass.new(options)
begin
puts "SASS: Converting SASS files (in #{source_dir}) into CSS files (in #{dest_dir})"
sass.parse!
rescue SystemExit => se
puts "SASS: Done."
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
java -jar ~/.m2/repository/org/jruby/jruby-complete/1.6.5/jruby-complete-1.6.5.jar -S gem env
RubyGems Environment: