Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethicalmohit/a9cb747e1266155db837af4050f9978c to your computer and use it in GitHub Desktop.
Save ethicalmohit/a9cb747e1266155db837af4050f9978c to your computer and use it in GitHub Desktop.
IMPORTANT NOTICE:
If there's a metagem available for your cloud provider, e.g. `fog-aws`,
you should be using it instead of requiring the full fog collection to avoid
unnecessary dependencies.
'fog' should be required explicitly only if the provider you use doesn't yet
have a metagem available.
------------------------------
Successfully installed fog-2.0.0
Parsing documentation for json-2.1.0
Installing ri documentation for json-2.1.0
Parsing documentation for rbovirt-0.1.5
Installing ri documentation for rbovirt-0.1.5
Parsing documentation for fog-ovirt-1.0.1
Installing ri documentation for fog-ovirt-1.0.1
Parsing documentation for fog-2.0.0
Installing ri documentation for fog-2.0.0
Done installing documentation for json, rbovirt, fog-ovirt, fog after 15 seconds
4 gems installed
[25430] Puma starting in cluster mode...
[25430] * Version 3.11.3 (ruby 2.3.1-p112), codename: Love Song
[25430] * Min threads: 5, max threads: 5
[25430] * Environment: production
[25430] * Process workers: 2
[25430] * Preloading application
[25430] ! Unable to load application: Bundler::GemRequireError: There was an error while trying to load the gem 'fog'.
Gem Load Error is: non-absolute home
Backtrace for gem load error is:
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/cache.rb:94:in `expand_path'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/cache.rb:94:in `<class:Cache>'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/cache.rb:84:in `<module:Fog>'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/cache.rb:6:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/model.rb:2:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core.rb:42:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-1.41.0/lib/fog.rb:9:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
/home/ubuntu/code/example/current/config/application.rb:9:in `<top (required)>'
/home/ubuntu/code/example/current/config/environment.rb:2:in `require'
/home/ubuntu/code/example/current/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:55:in `initialize'
config.ru:in `new'
config.ru:in `<main>'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:49:in `eval'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:49:in `new_from_string'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:40:in `parse_file'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/configuration.rb:318:in `load_rackup'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/configuration.rb:243:in `app'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/runner.rb:138:in `load_and_bind'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/cluster.rb:397:in `run'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/launcher.rb:183:in `run'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/cli.rb:77:in `run'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/bin/puma:10:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/bin/puma:23:in `load'
/usr/local/rvm/gems/ruby-2.3.1/bin/puma:23:in `<main>'
/usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
Bundler Error Backtrace:
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'fog'. (Bundler::GemRequireError)
Gem Load Error is: non-absolute home
Backtrace for gem load error is:
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/cache.rb:94:in `expand_path'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/cache.rb:94:in `<class:Cache>'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/cache.rb:84:in `<module:Fog>'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/cache.rb:6:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core/model.rb:2:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-core-1.45.0/lib/fog/core.rb:42:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/fog-1.41.0/lib/fog.rb:9:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
/home/ubuntu/code/example/current/config/application.rb:9:in `<top (required)>'
/home/ubuntu/code/example/current/config/environment.rb:2:in `require'
/home/ubuntu/code/example/current/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:55:in `initialize'
config.ru:in `new'
config.ru:in `<main>'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:49:in `eval'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:49:in `new_from_string'
/usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:40:in `parse_file'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/configuration.rb:318:in `load_rackup'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/configuration.rb:243:in `app'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/runner.rb:138:in `load_and_bind'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/cluster.rb:397:in `run'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/launcher.rb:183:in `run'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/cli.rb:77:in `run'
/usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/bin/puma:10:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/bin/puma:23:in `load'
/usr/local/rvm/gems/ruby-2.3.1/bin/puma:23:in `<main>'
/usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
Bundler Error Backtrace:
from /usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:80:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
from /usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
from /usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
from /usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
from /usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
from /home/ubuntu/code/example/current/config/application.rb:9:in `<top (required)>'
from /home/ubuntu/code/example/current/config/environment.rb:2:in `require'
from /home/ubuntu/code/example/current/config/environment.rb:2:in `<top (required)>'
from config.ru:3:in `require'
from config.ru:3:in `block in <main>'
from /usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:55:in `instance_eval'
from /usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:55:in `initialize'
from config.ru:in `new'
from config.ru:in `<main>'
from /usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:49:in `eval'
from /usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:49:in `new_from_string'
from /usr/local/rvm/gems/ruby-2.3.1/gems/rack-1.6.9/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/configuration.rb:318:in `load_rackup'
from /usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/configuration.rb:243:in `app'
from /usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/runner.rb:138:in `load_and_bind'
from /usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/cluster.rb:397:in `run'
from /usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/launcher.rb:183:in `run'
from /usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/lib/puma/cli.rb:77:in `run'
from /usr/local/rvm/gems/ruby-2.3.1/gems/puma-3.11.3/bin/puma:10:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.1/bin/puma:23:in `load'
from /usr/local/rvm/gems/ruby-2.3.1/bin/puma:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
@patakijv
Copy link

patakijv commented Jul 7, 2018

Did you find a resolution with this issue of "Gem Load Error is: non-absolute home" at "fog-core-1.45.0/lib/fog/core/cache.rb:94:in 'expand_path'" ? I am getting this exact issue with the same gem version of fog. When I inspect ENV['HOME'] at the console it is set to/home/app. The line #94 referred to that is failing in the backtrace is SANDBOX = ENV["HOME"] ? File.expand_path("~/.fog-cache") : File.expand_path(".fog-cache") so for some reason when the apps starts up (the backtrace from development environment shows the call is coming from spring preloader and it is on docker container startup using phusion's baseimage runit when this occurs) ENV['HOME'] is apparently not set... and I see the same error you show. This didn't occur in previous versions. Any clues?

@patakijv
Copy link

patakijv commented Jul 7, 2018

Responding to my own comment as I narrowed this down to the base docker image we use from Phusion is intentionally ignoring HOME. We must have apparently upgraded the version of baseimage as we also upgraded the fog version. According to phusion/baseimage-docker#119 (comment) the solution for us for now was to add RUN echo /root > /etc/container_environment/HOME to our Dockerfile which makes ENV['HOME'] set to /root when runit is run at container startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment