The solution as Tom's clue said was putting sass/compass gems path at the LOAD_PATH.
So the script to make sass/compass run under weblogic 10.3.6 was:
sassGemDir = 'D:/compass-gems/gems/sass-3.2.13/lib'
compassGemDir = 'D:/compass-gems/gems/compass-0.12.2/lib'
chunkyPngGemDir = 'D:/compass-gems/gems/chunky_png-1.2.9/lib'
fssmGemDir = 'D:/compass-gems/gems/fssm-0.2.10/lib'
$LOAD_PATH.insert(0,sassGemDir,remoteSassGemDir,compassGemDir,chunkyPngGemDir,fssmGemDir)
require 'rubygems'
require 'sass/plugin'
require 'sass/engine'
source = '...the scss code....'
engine = Sass::Engine.new(source,{ :syntax => :scss,:compass => {:css_dir => '/styles',:js_dir => '/scripts',images_dir => '/images'} })
result = engine.render
NOTE:
Finally I didn't managed to make jruby load sass/compass from a JAR so there's NO need to create an uber-jar that contains jruby-complete and sass/compass (step 2 in my question)
The only change in the ruby-script to run sass/compass from a JAR is:
sassGemDir = 'classpath:/gems/sass-3.2.13/lib'
compassGemDir = 'classpath/compass-0.12.2/lib'
chunkyPngGemDir = 'classpath/gems/chunky_png-1.2.9/lib'
fssmGemDir = 'classpath/gems/fssm-0.2.10/lib'
BUT when I run sass/compass loading from the uber-jar I got two errors:
compass's sprite-importer.rb failed to load sprite_importer.erb file since it was loaded like:
TEMPLATE_FOLDER = File.join(File.expand_path('../', __FILE__), 'sprite_importer')
so I changed sprite-importer.rb to:
TEMPLATE_FOLDER = File.join( File.expand_path(File.join(File.dirname(__FILE__))),'sprite_importer')
and this problem went away
compass's frameworks.rb failed to load the frameworks dir: jruby cannot load a dir's contents when the dir is inside a JAR (I susspect it's an error with java 6 or jrockit, which is the JDK I use in weblogic 10.3.6)
I could not find a solution for this problem so I switched to load sass/compass to be loaded directly from the filesystem and NOT from a JAR file
FINAL NOTE All the problems with the GEMs LOAD_PATH and compass being loaded from within a JAR were NOT an issue when running inside TOMCAT under Java 7
Hope this helps someone who's trying to run sass/compass using an embeded jruby