Sass, compass and JRuby in a single jar

Use JRuby to create a single runnable jar with sass and compass functionality.

  1. Go to http://www.jruby.org/download, download the latest JRuby <version> Complete .jar
  2. Make a copy of the downloaded jar(for example, jruby-complete-1.7.10.jar):
    cp jruby-complete-1.7.10.jar jruby-complete.jar
    or
    copy jruby-complete-1.7.10.jar jruby-complete.jar
  3. Install the necessary gems locally:
    java -jar jruby-complete.jar -S gem install -i ./compass-gems shared --no-rdoc --no-ri 
    java -jar jruby-complete.jar -S gem install -i ./compass-gems sass --no-rdoc --no-ri 
    java -jar jruby-complete.jar -S gem install -i ./compass-gems compass --no-rdoc --no-ri
  4. Rename the jruby-complete.jar file to jcompass.jar
    mv jruby-complete.jar jcompass.jar
    or
    move jruby-complete.jar jcompass.jar
  5. Now compile all into one jar
    jar uf jcompass.jar -C compass-gems .
  6. All done! Test it:
    java -jar jcompass.jar -S compass create --help
    java -jar jcompass.jar -S compass compile --help
    java -jar jcompass.jar -S compass watch --help

One comment :

Leave a Reply

↑ Back to top