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

couldn't find HOME environment -- expanding `~' #746

Closed
lencioni opened this issue Mar 3, 2016 · 6 comments
Closed

couldn't find HOME environment -- expanding `~' #746

lencioni opened this issue Mar 3, 2016 · 6 comments
Labels

Comments

@lencioni
Copy link
Collaborator

lencioni commented Mar 3, 2016

I'm setting up scss-lint in a new environment and am running into this when I run bundle exec scss-lint.

couldn't find HOME environment -- expanding `~'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/config.rb:42:in `home'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/config.rb:42:in `user_file'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/config.rb:204:in `initialize'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/plugins/linter_dir.rb:9:in `new'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/plugins/linter_dir.rb:9:in `initialize'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/plugins.rb:29:in `new'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/plugins.rb:29:in `block in plugin_directories'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/plugins.rb:28:in `map'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/plugins.rb:28:in `plugin_directories'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/plugins.rb:18:in `all'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/plugins.rb:12:in `load'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/config.rb:235:in `load_plugins'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/config.rb:28:in `load'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/config.rb:15:in `default'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/config.rb:31:in `load'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/cli.rb:139:in `setup_configuration'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/cli.rb:54:in `act_on_options'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/lib/scss_lint/cli.rb:33:in `run'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/gems/scss_lint-0.47.1/bin/scss-lint:7:in `<top (required)>'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/bin/scss-lint:23:in `load'
/tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/vendor/bundle/ruby/1.9.1/bin/scss-lint:23:in `<main>'
Report this bug at https://github.com/brigade/scss-lint/issues
To help fix this issue, please include:
- The above stack trace
- SCSS-Lint version: 0.47.1
- Sass version: 3.4.21
- Ruby version: 1.9.3
- Contents of /tmp/d20160303-22941-rc8ll2/monorail-solano-ghe/.scss-lint.yml

This is a CI environment where we are creating a tmp dir via Dir.mktmpdir to run things in. We take this path and later set the HOME environment variable to it by passing it to Open3.popen2e when we run bundle exec scss-lint, which is where we get this error. We also have other jobs in here that from what I can tell are set up in the same way to set this environment variable and then run a different bundle exec command (e.g. rspec and rubocop), but those don't blow up in this way. Any ideas on what is happening here?

For reference, this is the line that is blowing up (I believe on the call to Dir.home): https://github.com/brigade/scss-lint/blob/e6d20f537d021445da9583cbe1ec29bcded5ec32/lib/scss_lint/config.rb#L42

@sds sds added the question label Mar 3, 2016
@sds
Copy link
Owner

sds commented Mar 3, 2016

The error could only be caused by your environment not having a HOME variable defined.

You can verify this by trying:

⨠ ruby -e "puts Dir.home"
/Users/shane
⨠ env -i ruby -e "puts Dir.home"
-e:1:in `home': couldn't find HOME environment -- expanding `~' (ArgumentError)
    from -e:1:in `<main>'

There's not much else I believe I can offer here–you'll need to dig into your CI environment to figure out what's going on.

@lencioni
Copy link
Collaborator Author

lencioni commented Mar 3, 2016

Yeah, I think you are right. I think I trace through the execution path more closely and see if I can find a missing link. Thanks!

@lencioni lencioni closed this as completed Mar 3, 2016
@modkaffes
Copy link

@lencioni Did you ever find a solution to this issue? It's still plaguing my local env due to my lack of ruby experience.

@lencioni
Copy link
Collaborator Author

lencioni commented Sep 8, 2017

@modkaffes I think I fixed it but it was too long ago now I don't remember what I did. Sorry!

@modkaffes
Copy link

@lencioni No problem, it was a really long shot posting in a thread this old. I'll try to find a solution myself, too. Thank you!

@modkaffes
Copy link

modkaffes commented Sep 26, 2017

I'm putting this here for future self-reference in case this issue happens again, and of course for anyone that might have the same problem.

After much research regarding how Ruby detects User's home dir, I stumbled upon this comment:
AtomLinter/linter-rubocop#168 (comment), which made me realize I also had some problematic zplug plugin in my .zshrc, namely knu/z.

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

No branches or pull requests

3 participants