Problem using add_import_path

2,594 views
Skip to first unread message

Gary Clarke

unread,
Oct 6, 2011, 7:05:31 PM10/6/11
to compas...@googlegroups.com
I have some partials imported from a directory that is a child of the sass project root but is not within the sass folder.

Changes to these partials are not recognized by compass watch. I've tried using additional_import_paths and add_import_path. For example:

sass_dir = "sass"
add_import_path "./shared/sass"

I've also tried using an absolute path:
add_import_path "c:\\docs\\visual studio 2010\\projects\\napp\\assets\\shared\\sass"

I know that the configuration option is recognized and the path is valid because changing the path a bit to something invalid causes an error when compass watch is started.

Any ideas?

Thanks,
Gary

Gary Clarke

unread,
Oct 10, 2011, 1:05:53 PM10/10/11
to compas...@googlegroups.com
Just following up on this... any thoughts from anyone?

Chris Eppstein

unread,
Oct 10, 2011, 1:07:42 PM10/10/11
to compas...@googlegroups.com
do you experience the same issue if you run compass watch with the --poll option?

chris

On Mon, Oct 10, 2011 at 10:05 AM, Gary Clarke <gxcl...@gmail.com> wrote:
Just following up on this... any thoughts from anyone?

--
You received this message because you are subscribed to the Google Groups "Compass" group.
To view this discussion on the web visit https://groups.google.com/d/msg/compass-users/-/1I4EhFs46ZEJ.

To post to this group, send email to compas...@googlegroups.com.
To unsubscribe from this group, send email to compass-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.

Martin Alker

unread,
Feb 10, 2012, 5:56:29 AM2/10/12
to compas...@googlegroups.com
I have the same problem with both options: additional_import_paths and  add_import_path. Nothing happens.

Martin Alker

unread,
Feb 20, 2012, 12:22:34 PM2/20/12
to compas...@googlegroups.com
It works! Put @import "dummy" (example) in any .scss file and then Compass imports the dummy in this .scss/css file. The whole time I think it would create a separate CSS file.

Chris Eppstein

unread,
Feb 20, 2012, 3:38:52 PM2/20/12
to compas...@googlegroups.com
Ah! Yes, all this feature does is allow you to @import to find files from new locations. Sorry if that wasn't clear.

chris

On Mon, Feb 20, 2012 at 9:22 AM, Martin Alker <martin...@googlemail.com> wrote:
It works! Put @import "dummy" (example) in any .scss file and then Compass imports the dummy in this .scss/css file. The whole time I think it would create a separate CSS file.

--
You received this message because you are subscribed to the Google Groups "Compass" group.
To view this discussion on the web visit https://groups.google.com/d/msg/compass-users/-/_2tkhHTHN8QJ.

Luis Martins

unread,
Mar 5, 2013, 9:29:15 AM3/5/13
to compas...@googlegroups.com
Hi,

I've also tried to use this feature several times but always get the "File to import not found" error.

Im adding the following to the config.rb:
add_import_path = "/Users/luismartins/Sites/cidadela_sistema/Nova Implementacao/common"

and the following to my scss:
@import "common-layout";

I've tried with relative and absolute paths but no luck at any of those.

Am i missing something?

Thanks.

rober...@gmail.com

unread,
Mar 5, 2013, 11:34:46 PM3/5/13
to compas...@googlegroups.com
I believe that you forgot the drive letter. Try :
add_import_path = "C:/Users/luismartins/Sites/cidadela_sistema/Nova Implementacao/common"
or
add_import_path = "C:\\Users\\luismartins\\Sites\\cidadela_sistema\\Nova Implementacao\\common"

Luis Martins

unread,
Mar 6, 2013, 1:54:39 PM3/6/13
to compas...@googlegroups.com
Hey, thanks.

Im on a mac where the drive letter is not needed as the path in question is unique.


Jeremy Iglehart

unread,
Mar 6, 2013, 5:03:19 PM3/6/13
to compas...@googlegroups.com
Luis et al,


I've added the add_import_path use case here, and tested it, so you can see how to properly use the add_import_path function.

The key here is to understand that add_import_path is not a variable that you are declaring, it is actually a function you're calling and therefor you cannot use a '=' sign.  If you actually check the compass reference it is clear that the add_import_path function is not a variable, but a function that adds the passed string to the additional_import_paths configuration property.

I wrote a more detailed, easier to read and understand, explanation (in markdown) and it can be found here:

See the Compass Reference:

See my example config.rb that has been configured properly here:

Download my repository and try it on your local machine by executing these commands in your terminal:
(Mac/Linux only, Sorry windows folks, I won't test it on Windows - I'm sure you know how to change it though)

cd [where-ever-you-want-to-play-with-this]
git clone g...@github.com:uberbuilder/testCompassGemImportOverride.git
cd testCompassGemImportOverride
vim scss/screen.scss

   (or use whatever editor you'd prefer)
   (now make some changes, any change - even if it's just adding a return line somewhere, then save and quit)

compass watch

You'll see that it works fine, if not than you might have a deeper problem.  My suggestion is to check what is happening with your development environment.  Make sure you are using the correct versions of ruby/sass/compass.

Cheers,
-Jeremy



On Wed, Mar 6, 2013 at 1:54 PM, Luis Martins <kim...@gmail.com> wrote:
Hey, thanks.

Im on a mac where the drive letter is not needed as the path in question is unique.

--
You received this message because you are subscribed to the Google Groups "Compass" group.
To unsubscribe from this group and stop receiving emails from it, send an email to compass-user...@googlegroups.com.

To post to this group, send email to compas...@googlegroups.com.

rober...@gmail.com

unread,
Mar 7, 2013, 8:49:23 AM3/7/13
to compas...@googlegroups.com
Ah, the "Users" folder is typical for Windows (Vista/7/8) PCs. That's why I thought you were on Windows.
Message has been deleted

rober...@gmail.com

unread,
Mar 7, 2013, 8:54:20 AM3/7/13
to compas...@googlegroups.com
No problems here. But thanks anyway.

On Wednesday, March 6, 2013 11:03:19 PM UTC+1, Jeremy Iglehart wrote:
Luis et al,

Jeremy Iglehart

unread,
Mar 7, 2013, 9:26:21 AM3/7/13
to compas...@googlegroups.com
Regardless of Mac/PC, the trick it to not be using an equals sign ( = ) when using this function.

add_import_path "your_path"     #Correct
add_import_path = "your_path"  #Incorrect

Unless for some reason that too is different in the Windows environment, though I doubt it.


rober...@gmail.com

unread,
Mar 7, 2013, 9:55:18 AM3/7/13
to compas...@googlegroups.com
Yes Sir. You have hawk eyes. No equal sign indeed. I just checked it here : http://compass-style.org/help/tutorials/configuration-reference/
I missed that one in Luis post.
Reply all
Reply to author
Forward
0 new messages