GithubHelp home page GithubHelp logo

Comments (8)

theasteve avatar theasteve commented on August 17, 2024 4

I am also having issues when deploying a Rails 5 app to AWS using elastic beanstalk, I get the following output in the logs:


Application update failed at 2017-10-24T19:27:36Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed.

    ++ /opt/elasticbeanstalk/bin/get-config container -k script_dir
    + EB_SCRIPT_DIR=/opt/elasticbeanstalk/support/scripts
    ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
    + EB_APP_STAGING_DIR=/var/app/ondeck
    ++ /opt/elasticbeanstalk/bin/get-config container -k app_user
    + EB_APP_USER=webapp
    ++ /opt/elasticbeanstalk/bin/get-config container -k support_dir
    + EB_SUPPORT_DIR=/opt/elasticbeanstalk/support
    + . /opt/elasticbeanstalk/support/envvars
    ++ export RACK_ENV=production
    ++ RACK_ENV=production
    ++ export RAILS_SKIP_ASSET_COMPILATION=false
    ++ RAILS_SKIP_ASSET_COMPILATION=false
    ++ export RAILS_SKIP_MIGRATIONS=false
    ++ RAILS_SKIP_MIGRATIONS=false
    ++ export BUNDLE_WITHOUT=test:development
    ++ BUNDLE_WITHOUT=test:development
    ++ export RDS_PORT=5432
    ++ RDS_PORT=5432
    ++ export RDS_HOSTNAME=aa16lalntiz6vr0.cghvpjf0tzo5.us-east-1.rds.amazonaws.com
    ++ RDS_HOSTNAME=aa16lalntiz6vr0.cghvpjf0tzo5.us-east-1.rds.amazonaws.com
    ++ export RDS_USERNAME=theasteve
    ++ RDS_USERNAME=theasteve
    ++ export RDS_DB_NAME=ebdb
    ++ RDS_DB_NAME=ebdb
    ++ export RDS_PASSWORD=Colombia1
    ++ RDS_PASSWORD=Colombia1
    + RAKE_TASK=assets:precompile
    + . /opt/elasticbeanstalk/support/scripts/use-app-ruby.sh
    ++ . /usr/local/share/chruby/chruby.sh
    +++ CHRUBY_VERSION=0.3.9
    +++ RUBIES=()
    +++ for dir in '"$PREFIX/opt/rubies"' '"$HOME/.rubies"'
    +++ [[ -d /opt/rubies ]]
    ++++ ls -A /opt/rubies
    +++ [[ -n ruby-1.9.3-p551
    ruby-2.0.0-p648
    ruby-2.1.10
    ruby-2.2.8
    ruby-2.3.5
    ruby-2.4.2
    ruby-current ]]
    +++ RUBIES+=("$dir"/*)
    +++ for dir in '"$PREFIX/opt/rubies"' '"$HOME/.rubies"'
    +++ [[ -d /.rubies ]]
    +++ unset dir
    +++ cat /etc/elasticbeanstalk/.ruby_version
    ++ chruby 2.3.5
    ++ case "$1" in
    ++ local dir match
    ++ for dir in '"${RUBIES[@]}"'
    ++ dir=/opt/rubies/ruby-1.9.3-p551
    ++ case "${dir##*/}" in
    ++ for dir in '"${RUBIES[@]}"'
    ++ dir=/opt/rubies/ruby-2.0.0-p648
    ++ case "${dir##*/}" in
    ++ for dir in '"${RUBIES[@]}"'
    ++ dir=/opt/rubies/ruby-2.1.10
    ++ case "${dir##*/}" in
    ++ for dir in '"${RUBIES[@]}"'
    ++ dir=/opt/rubies/ruby-2.2.8
    ++ case "${dir##*/}" in
    ++ for dir in '"${RUBIES[@]}"'
    ++ dir=/opt/rubies/ruby-2.3.5
    ++ case "${dir##*/}" in
    ++ match=/opt/rubies/ruby-2.3.5
    ++ for dir in '"${RUBIES[@]}"'
    ++ dir=/opt/rubies/ruby-2.4.2
    ++ case "${dir##*/}" in
    ++ for dir in '"${RUBIES[@]}"'
    ++ dir=/opt/rubies/ruby-current
    ++ case "${dir##*/}" in
    ++ [[ -z /opt/rubies/ruby-2.3.5 ]]
    ++ shift
    ++ chruby_use /opt/rubies/ruby-2.3.5 ''
    ++ [[ ! -x /opt/rubies/ruby-2.3.5/bin/ruby ]]
    ++ [[ -n '' ]]
    ++ export RUBY_ROOT=/opt/rubies/ruby-2.3.5
    ++ RUBY_ROOT=/opt/rubies/ruby-2.3.5
    ++ export RUBYOPT=
    ++ RUBYOPT=
    ++ export PATH=/opt/rubies/ruby-2.3.5/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
    ++ PATH=/opt/rubies/ruby-2.3.5/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
    +++ /opt/rubies/ruby-2.3.5/bin/ruby -
    ++ eval 'export RUBY_ENGINE=ruby;
    export RUBY_VERSION=2.3.5;
    export GEM_ROOT="/opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0";'
    +++ export RUBY_ENGINE=ruby
    +++ RUBY_ENGINE=ruby
    +++ export RUBY_VERSION=2.3.5
    +++ RUBY_VERSION=2.3.5
    +++ export GEM_ROOT=/opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0
    +++ GEM_ROOT=/opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0
    ++ (( 0 != 0 ))
    + cd /var/app/ondeck
    + su -s /bin/bash -c 'bundle exec /opt/elasticbeanstalk/support/scripts/check-for-rake-task.rb assets:precompile' webapp
    `/home/webapp` is not a directory.
    Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
    + '[' false == true ']'
    + su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
    `/home/webapp` is not a directory.
    Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
    rake aborted!
    Bundler::GemRequireError: There was an error while trying to load the gem 'rb-readline'.
    Gem Load Error is: HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory
    Backtrace for gem load error is:
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.4/lib/rbreadline.rb:1097:in `<module:RbReadline>'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.4/lib/rbreadline.rb:17:in `<top (required)>'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.4/lib/readline.rb:10:in `require'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.4/lib/readline.rb:10:in `<module:Readline>'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.4/lib/readline.rb:8:in `<top (required)>'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.4/lib/rb-readline.rb:16:in `require'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.4/lib/rb-readline.rb:16:in `<top (required)>'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:82:in `require'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in `each'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in `block in require'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in `each'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in `require'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler.rb:108:in `require'
    /var/app/ondeck/config/application.rb:17:in `<top (required)>'
    /var/app/ondeck/Rakefile:4:in `require_relative'
    /var/app/ondeck/Rakefile:4:in `<top (required)>'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
    /opt/rubies/ruby-2.3.5/bin/rake:23:in `load'
    /opt/rubies/ruby-2.3.5/bin/rake:23:in `<top (required)>'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:74:in `load'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:74:in `kernel_load'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:27:in `run'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli.rb:360:in `exec'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli.rb:20:in `dispatch'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli.rb:10:in `start'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/exe/bundle:35:in `block in <top (required)>'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
    /opt/rubies/ruby-2.3.5/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/exe/bundle:27:in `<top (required)>'
    /opt/rubies/ruby-2.3.5/bin/bundle:23:in `load'
    /opt/rubies/ruby-2.3.5/bin/bundle:23:in `<main>'
    Bundler Error Backtrace:
    /var/app/ondeck/config/application.rb:17:in `<top (required)>'
    /var/app/ondeck/Rakefile:4:in `require_relative'
    /var/app/ondeck/Rakefile:4:in `<top (required)>'
    /opt/rubies/ruby-2.3.5/bin/bundle:23:in `load'

from rb-readline.

luislavena avatar luislavena commented on August 17, 2024

Thank you for the report pilcrow

Can you propose a patch?

Right now the system defines HOME to be able to expand and locate inputrc and history files in the user home directory.

Regards.

from rb-readline.

rdp avatar rdp commented on August 17, 2024

Perhaps
File.expand_path '~' would help

from rb-readline.

Spakman avatar Spakman commented on August 17, 2024

@rdp - I think that File.expand_path("~") uses ENV["HOME"].

Kind of thinking out loud - perhaps we could print something to STDERR if rb-readline tries to tilde expand without ENV["HOME"] being set? Is there anything obviously wrong with that approach?

from rb-readline.

mdarby avatar mdarby commented on August 17, 2024

I just ran into this issue myself while running a rake task through god on Ubuntu. I set ENV["HOME"] = <home directory> and all worked as expected.

Not to nitpick, but a raised error when the ENV["HOME"] var is empty would help.

from rb-readline.

qichunren avatar qichunren commented on August 17, 2024

I also got this problem:
https://github.com/luislavena/rb-readline/blob/master/lib/rbreadline.rb#L1093
ENV["HOME"] ||= ENV["HOMEDRIVE"]+ENV["HOMEPATH"]

<module:RbReadline>': undefined method+' for nil:NilClass (NoMethodError)

from rb-readline.

njvack avatar njvack commented on August 17, 2024

If I don't have ENV['HOME'] set, it's a pretty good bet that I don't care about history or inputrc.

I'd propose:

ENV['HOME'] ||= "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}"

which would defer whatever evils may come from not having a home directory until later. If that might cause Evil, follow it up with:

if !File.directory? ENV['HOME']
  raise RuntimeError.new("The HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory")
end

Yes, I just spent a day trying to figure out a deployment issue that stemmed from this, too.

from rb-readline.

Spakman avatar Spakman commented on August 17, 2024

I've left this open, as I would like to see us not require these variables at all.

However, this is a definite improvement - thanks, @njvack :)!

from rb-readline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.