Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Compass will not build (exit code 255) #59

Closed
raduluchian opened this issue Jun 14, 2015 · 11 comments
Closed

Compass will not build (exit code 255) #59

raduluchian opened this issue Jun 14, 2015 · 11 comments

Comments

@raduluchian
Copy link

I have this plugin installed in Sublime Text 3 and whenever I want to build I get this in the console:

\projects\website' was unexpected at this time.
[Finished in 0.1s with exit code 255]
[cmd: build.cmd "G:\projects\website\scss\modules" "G:\projects\website"]
[dir: C:\Users\Radu\AppData\Roaming\Sublime Text 3\Packages\Compass]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\WinSCP\;C:\Ruby\bin]

This issue has been described by someone else on Stack Overflow, but with no resolution:

http://stackoverflow.com/questions/25229159/sass-compass-will-not-build-exit-code-255-sublime-text-3#comment49709536_25229159

It's worth mentioning that I am running the same configuration at home as at the office with the difference that at the office I am running on Linux Mint and at home on Windows 8.1.

@renestalder
Copy link
Contributor

Hi @raduluchian. So as I understand, you get the exact same error in the same project on both machines, independent of the OS you're running. Sounds like the project setup is wrong for the the build system first instance. But lets try to get some more details.

What does your compass config (config.rb) looks like? It should be stored in the root folder of your project.

Also, did you try to compile via console & terminal with a raw compass command?

@raduluchian
Copy link
Author

Sorry for not being more clear on the last part. The same project is working on my Linux Mint machine (office) but it's not working on my Windows 8.1 machine (home). The config file is the same on both machines.

I haven't tried compiling via terminal yet but I have successfully compiled using Compass.app. I will share the config.rb file this evening.

@renestalder
Copy link
Contributor

Is it possible that it could be related to backslashes #58 on Windows? I'm not sure Compass.app takes the config.rb or maintaining its own configuration.

@raduluchian
Copy link
Author

I will try looking into the backslashes as well. As far as the config.rb file goes, I know that Compass.app uses the file found in the root of the project and if it's not there it throws an error.

@raduluchian
Copy link
Author

These are the contents of my config.rb file:

css_dir = "css"
sass_dir = "scss"
images_dir = "img"
output_style = :expanded
relative_assets = true
line_comments = false
sass_options = {:debug_info=>false}
sourcemap = false

@renestalder
Copy link
Contributor

Can you try to run the compass command directly from the console on your Windows machine? Of course in your project root folder.

compass compile

I would like to find out if it's related to the package or your environment. And I still think, the Compass.app includes compass itself and does not rely on the local installation of the compass gem.

@raduluchian
Copy link
Author

Just tried compiling from the comand line as you suggested and it works fine.

@renestalder
Copy link
Contributor

So my next guess is, the path of your project contains some special chars and the windows batch seems to have problems with them in the for-loop. That's also what I see in the stackoverflow thread.

Do you have special chars like brackets or braces in your path? If yes, could you try to move your project to a more generic path and test it again?

Good

C:\mypath\projects\my_project

Bad

C:\mypath\projects\my_project (1)\mysuperwebsite

@raduluchian
Copy link
Author

Indeed the issue was in the project path. The name of the folder used to be:

F:\Project\Website (development)\

After having done a bit of restructuring I've renamed it into:

F:\Project\Website\Development\

Now the code is compiled as expected, so I have a working plugin that does it's job properly. Thanks a lot for the patience and help, René!

Is there however a way to have it work with paths such as the one I originally had?

@renestalder
Copy link
Contributor

The batch file of this package uses a for loop to loop trough a list of folders or files. This part may have to be encoded correctly to work with all path.

I'm not a windows batch pro. But what I found is, that the /r command should do this.
https://stackoverflow.com/questions/10564761/how-to-deal-with-possible-special-characters-when-iterating-files-with-for-comma

So you could try to edit the batch file (Preferences → Browse Packages, then go to the Compass folder) and change the /f in the loop to a /r, like this:
https://gist.github.com/renestalder/6786d144655db47d4dd2

I didn't tested it. No clue if it works and if it solves the problem and when, if it solves it for all path. It's worth a try.

Anyway, I will add your case to the F.A.Q. in the readme.

@raduluchian
Copy link
Author

Ok, will look into it to see if that solution works. Thanks for the help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants