本地测试服务器运行页面时,突然出现了“Unable to parse SASS on CSS”的错误,同样的theme在本机上运行一点没有问题,放到了linux就出了问题,经过不懈的搜索,发现在portal-ext.properties里加如下代码即可解决问题:
scripting.jruby.load.paths=\
classpath:/META-INF/jruby.home/lib/ruby/site_ruby/1.8,\
classpath:/META-INF/jruby.home/lib/ruby/site_ruby/shared,\
classpath:/META-INF/jruby.home/lib/ruby/1.8,\
classpath:/gems/chunky_png-1.2.1/lib,\
classpath:/gems/compass-0.11.5/lib,\
classpath:/gems/fssm-0.2.7/lib,\
classpath:/gems/sass-3.1.7/lib,\
file:${liferay.lib.portal.dir}ruby-gems.jar!/gems/chunky_png-1.2.1/lib,\
file:${liferay.lib.portal.dir}ruby-gems.jar!/gems/compass-0.11.5/lib,\
file:${liferay.lib.portal.dir}ruby-gems.jar!/gems/fssm-0.2.7/lib,\
file:${liferay.lib.portal.dir}ruby-gems.jar!/gems/sass-3.1.7/lib
classpath:/META-INF/jruby.home/lib/ruby/site_ruby/1.8,\
classpath:/META-INF/jruby.home/lib/ruby/site_ruby/shared,\
classpath:/META-INF/jruby.home/lib/ruby/1.8,\
classpath:/gems/chunky_png-1.2.1/lib,\
classpath:/gems/compass-0.11.5/lib,\
classpath:/gems/fssm-0.2.7/lib,\
classpath:/gems/sass-3.1.7/lib,\
file:${liferay.lib.portal.dir}ruby-gems.jar!/gems/chunky_png-1.2.1/lib,\
file:${liferay.lib.portal.dir}ruby-gems.jar!/gems/compass-0.11.5/lib,\
file:${liferay.lib.portal.dir}ruby-gems.jar!/gems/fssm-0.2.7/lib,\
file:${liferay.lib.portal.dir}ruby-gems.jar!/gems/sass-3.1.7/lib
我用的liferay是6.1.1的版本,所以jruby的版本是那些,如果是别的版本的liferay,查找下jruby相关jar文件里的对应版本,修改下配置即可。估计是因为某种原因,系统找不到那些jruby文件所以无法解析saas了。