ThoughtWorksStudios / eb_deployer

AWS Elastic Beanstalk blue-green deployment automation from ThoughtWorks Mingle Team
MIT License
400 stars 94 forks source link

ArgumentError: couldn't find HOME environment -- expanding `~' - for container rake commands #74

Closed dashbitla closed 8 years ago

dashbitla commented 8 years ago

Here is my eb.yml configuration ...

  03-rake.config:
    container_commands:
      01-db-seed:
        command: "rake db:seed --trace"
        leader_only: true
      02-seed-privilges:
        command: "rake seed:privileges --trace"
        leader_only: true

It fails with the followirng error in /var/log/eb-activity.log

 ArgumentError: couldn't find HOME environment -- expanding `~'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/simplecov-0.9.1/lib/simplecov/defaults.rb:87:in `expand_path'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/simplecov-0.9.1/lib/simplecov/defaults.rb:87:in `<top (required)>'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/simplecov-0.9.1/lib/simplecov.rb:140:in `require'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/simplecov-0.9.1/lib/simplecov.rb:140:in `<top (required)>'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.6/lib/bundler/runtime.rb:76:in `require'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.6/lib/bundler/runtime.rb:72:in `each'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.6/lib/bundler/runtime.rb:72:in `block in require'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.6/lib/bundler/runtime.rb:61:in `each'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.6/lib/bundler/runtime.rb:61:in `require'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.9.6/lib/bundler.rb:134:in `require'
  /var/app/ondeck/config/application.rb:13:in `<top (required)>'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  /var/app/ondeck/Rakefile:5:in `<top (required)>'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load_rakefile'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/rake-11.1.2/lib/rake/application.rb:689:in `raw_load_rakefile'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/rake-11.1.2/lib/rake/application.rb:94:in `block in load_rakefile'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
  /opt/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/rake-11.1.2/lib/rake/application.rb:93:in `load_rakefile'
rickhull commented 8 years ago

I'm guessing simplecov makes a call to Dir.home or ~ when HOME is unset in the environment. See https://github.com/bbatsov/rubocop/issues/2901

rickhull commented 8 years ago

Yes, see https://github.com/colszowka/simplecov/pull/311

It looks like you're using a very old version of Ruby (1.9.3) and likely a very old version of simplecov that does not include this fix.

wpc commented 8 years ago

@rickhull thanks for replying this. closing this now.