title: Cleanest way to run susy, compass, and sass within jruby-complete?
body: <p>why can jruby find <code>require 'susy'</code> in my compass config.rb, but <code>@import 'susy'</code> within *.scss files produces the issue:</p>
  
  <pre><code> [java]     error Web Content/common/sass/base/foundation_de_DE.scss (Line 9: File to import not found or unreadable: susy.
          [java] Load paths:
          [java]   &lt;removed&gt;/Web Content/common/sass
  </code></pre>
  
  <p>My existing application wants to start using a responsive design on the front end.  However, installing ruby / compass on all the developer's machines, integration environments, performance environments and production would kill the initiative.</p>
  
  <p>per this <a href="https://stackoverflow.com/q/1751479/176818">question</a>, and this <a href="http://caueguerra.com/tutorial-using-sass-in-a-java-project" rel="nofollow noreferrer">simplified tutorial</a> I used our current Ant build.xml to make some targets using jRuby.</p>
  
  <p><a href="http://blog.nicksieger.com/articles/2009/01/10/jruby-1-1-6-gems-in-a-jar/" rel="nofollow noreferrer">gems in a jar</a> trick to so that I don't need to install ruby everywhere:
  downloaded jruby-complete-1.6.8.jar per <a href="https://github.com/jruby/jruby/issues/235" rel="nofollow noreferrer">latest jruby has relative path issue as of 2013.03.20</a></p>
  
  <pre><code>java -jar jruby-complete-1.6.8.jar -S gem install -i ./susy susy  
  jar uf jruby-complete-1.6.8.jar -C susy .  
  java -jar jruby-complete-1.6.8.jar -S gem list
  </code></pre>
  
  <p>ant target used during the build process:
  </p>
  
  <pre><code> &lt;target name="compass.compile"&gt;
       &lt;java classname="org.jruby.Main" fork="true" failonerror="true" classpathref="jruby.classpath"&gt;  
                  &lt;arg line="${basedir}/compile.rb ${basedir} compile ${basedir}"/&gt;   
              &lt;/java&gt;
       &lt;/target&gt;
  </code></pre>
  
  <p>ant target used by Eclipse based IDE to 'auto-compile' when a user saves a scss file.  <a href="http://wirelesswombat.com/2012/06/17/automatically-compling-sass-compass-in-eclipse-zend-studio/" rel="nofollow noreferrer">Instructions to have Eclipse 'auto-build' scss files (start at step #5)</a>
  </p>
  
  <pre><code>&lt;target name="compass.dev"&gt;
          &lt;path id="jruby.classpath"&gt;
              &lt;fileset dir="../../../release/lib/arch/jruby"&gt;
                  &lt;include name="jruby-complete.jar"/&gt;
              &lt;/fileset&gt;            
          &lt;/path&gt;
          &lt;java classname="org.jruby.Main" fork="true" failonerror="true" classpathref="jruby.classpath"&gt;  
              &lt;arg line="${basedir}/compile.rb ${basedir} compile ${basedir}"/&gt;  
          &lt;/java&gt;
      &lt;/target&gt;
  </code></pre>
  
  <p>Finally, here is the 'compile.rb' used by the ant target:
  </p>
  
  <pre><code>Dir.entries(ARGV[0]).each do |lib|  
      $LOAD_PATH.unshift "#{ARGV[0]}/#{lib}/lib"  
  end
  
  require 'rubygems'
  require 'compass' 
  require 'susy'
  require 'compass/exec'  
  
  exit Compass::Exec::SubCommandUI.new([ARGV[1], ARGV[2], "-q"]).run!
  </code></pre>
  
  <p>and the config.rb used by compass:
  </p>
  
  <pre><code> # Require any additional compass plugins here.  
  # Set this to the root of your project when deployed:
  require 'susy'
  
  http_path = "./Web Content/"  
  css_dir = "./Web Content/common/sass-output-css/"  
  sass_dir = "./Web Content/common/sass/"
  add_import_path  "./Web Content/sass"  
  images_dir = "./Web Content/common/images/"  
  javascripts_dir = "./Web Content/common/js/widgets"  
  # To enable relative paths to assets via compass helper functions. Uncomment:  
  #relative_assets = true  
  </code></pre>
  
  <p>and finally, trying to use susy in an scss file:
  </p>
  
  <pre><code>@import 'reset'; 
  @import 'utilities';
  @import 'baseColorVariables'; 
  @import 'font';  
  @import 'susy'; 
  
  
  $total-columns: 12; 
  $column-width: 4em; 
  $gutter-width: 1em; 
  $grid-padding: 1em;
  .magic-container { @include container; } 
  </code></pre>