Compass mixins not found when using directly from

2019-08-20 15:07发布

问题:

I am building a new ruby script using GLI gem that uses Compass within. However, whenever I run the app using bundle exec SASS/Compass can never seem to find the mixins that I include in my .scss file. I get the following error...

error: File to import not found or unreadable: compass/css3.

I know the solution is to set an environment variable. However, I have no clue as to which variable needs to be set.

Update:

I should have added that this is a follow up to another post that I had - Using Compass from Ruby (not shell)

Here is the code that I am using to invoke compass from my app.

require 'compass'
require 'sass/plugin'

compiler = Compass::Compiler.new('.','.','.',{:style => :compact})
compiler.compile(sass_file,css_file)

Here is the error that is getting thrown

error: File to import not found or unreadable: compass/css3.

Load path: /Volumes/MacRAID/joeworkman/Desktop/stake-test/Badges/Badges.source/Contents

I originally thought that this only happened when I was running under bundle exec. However, its does happen every time even if I were to run in it normally.

Update #2:

I am pretty certain that this is a SASS :load_paths issue. If I set my SASS_PATH environment variable to the below value everything works. I don't want to depend on environment variables though.

~/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets

回答1:

Make sure that you check out the answers on the below post. Between my findings posted here and the suggestions made on the other post, the question is answered.

Using Compass from Ruby (not shell)