Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$HOME/.compass/extensions autodiscovery crashes Rails under init #376

Closed
tessro opened this issue May 6, 2011 · 6 comments
Closed

$HOME/.compass/extensions autodiscovery crashes Rails under init #376

tessro opened this issue May 6, 2011 · 6 comments

Comments

@tessro
Copy link

tessro commented May 6, 2011

#242 (3272dc7) introduced a dependency on the Unix environment. If $HOME is not set, Compass fails to load. We're loading Compass inside Unicorn through init, which is a common use case. $HOME is unset.

For now we are reverting to 0.10 which works fine.

It seems to me that Compass extensions that are commonly needed should be rolled into gems of their own, and bundled into each application. Introducing ~/.compass/extensions, and loading from it by default, seems like a regression against all the work that's been done by the Bundler team to eliminate differences in environment between different development and production machines. It's opening the door to all sorts of fun-to-debug situations, where extensions present or missing, or versions differ between machines.

Here is the relevant part of the backtrace:

/home/deploy/site/shared/bundle/ruby/1.8/gems/compass-0.11.1/lib/compass.rb:18:in `expand_path': couldn't find HOME environment -- expanding `~/.compass/extensions' (ArgumentError)
        from /home/deploy/site/shared/bundle/ruby/1.8/gems/compass-0.11.1/lib/compass.rb:18:in `shared_extension_paths'
        from /home/deploy/site/shared/bundle/ruby/1.8/gems/compass-0.11.1/lib/compass/configuration/helpers.rb:105:in `discover_extensions!'
@tomtaylor
Copy link

I'm experiencing this issue too.

@paukul
Copy link

paukul commented May 16, 2011

same here. Worked around it for now by adding

ENV["HOME"] ||= "/var/www"

at the very top of application.rb for now. But that's not a very satisfying "solution" in any way

@ryenski
Copy link

ryenski commented May 18, 2011

@paukul's solution worked for me. Except I put it in my production.rb file.

@MoOx
Copy link
Contributor

MoOx commented May 25, 2011

I'm launching compass from a PHP called process, so I have the same issue.
For now I prefix my compass call with 'export HOME=' . $_SERVER['DOCUMENT_ROOT'] . ';'

@bhollis
Copy link

bhollis commented Jun 3, 2011

This is a duplicate of #364 and it's already been fixed in master.

@tessro
Copy link
Author

tessro commented Jun 3, 2011

@bhollis thanks for the catch. Closing.

@tessro tessro closed this as completed Jun 3, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants