Skip to content

Instantly share code, notes, and snippets.

@rnhurt
Created May 14, 2019 20:26
Show Gist options
  • Save rnhurt/0363630689f2d2d3a94fb8903c2c6bc8 to your computer and use it in GitHub Desktop.
Save rnhurt/0363630689f2d2d3a94fb8903c2c6bc8 to your computer and use it in GitHub Desktop.
RVM Error: "/usr/local/rvm/scripts/functions/support: line 182: _system_name: unbound variable"
#!/usr/bin/env bash
set -euo pipefail
prt ()
{
echo -e "\n\n" `date +'%Y-%m-%d %H:%M:%S'` "$1 \n"
}
prt "Installing Ruby"
set +eux
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -L https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
yes | rvm install ruby-2.3.4 -- --with-openssl-dir=/etc/pki/tls
set -eux
rvm --default use 2.3.4
2019-05-08 14:44:36 Installing Ruby
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net
gpg: requesting key 39499BDB from hkp server keys.gnupg.net
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key D39DC0E3: public key \"Michal Papis (RVM signing) <mpapis@gmail.com>\" imported
gpg: key 39499BDB: public key \"Piotr Kuczynski <piotr.kuczynski@gmail.com>\" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 2
gpg: imported: 2 (RSA: 2)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 194 100 194 0 0 4127 0 --:--:-- --:--:-- --:--:-- 4217
100 24168 100 24168 0 0 374k 0 --:--:-- --:--:-- --:--:-- 374k
Downloading https://github.com/rvm/rvm/archive/1.29.8.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.8/1.29.8.tar.gz.asc
gpg: Signature made Wed 08 May 2019 02:14:49 PM UTC using RSA key ID 39499BDB
gpg: Good signature from \"Piotr Kuczynski <piotr.kuczynski@gmail.com>\" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7D2B AF1C F37B 13E2 069D 6956 105B D0E7 3949 9BDB
GPG verified '/usr/local/rvm/archives/rvm-1.29.8.tgz'
Creating group 'rvm'
Installing RVM to /usr/local/rvm/
Installation of RVM in /usr/local/rvm/ is almost complete:
* First you need to add all users that will be using rvm to 'rvm' group,
and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.
* To start using RVM you need to run `source /etc/profile.d/rvm.sh`
in all your open shell windows, in rare cases you need to reopen all shell windows.
* Please do NOT forget to add your users to the <code>rvm</code> group.
The installer no longer auto-adds root or users to the rvm group. Admins must do this.
Also, please note that group memberships are ONLY evaluated at login time.
This means that users must log out then back in before group membership takes effect!
<warn>Thanks for installing RVM 🙏</warn>
Please consider donating to our open collective to help us maintain RVM.
👉 Donate: <code>https://opencollective.com/rvm/donate</code>
Checking requirements for amazon.
Installing requirements for amazon.
Installing required packages: libffi-devel, sqlite-devel, libyaml-devel......
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.3.4, this may take a while depending on your cpu(s)...
ruby-2.3.4 - #downloading ruby-2.3.4, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 13.7M 100 13.7M 0 0 36.2M 0 --:--:-- --:--:-- --:--:-- 36.3M
ruby-2.3.4 - #extracting ruby-2.3.4 to /usr/local/rvm/src/ruby-2.3.4.....
ruby-2.3.4 - #applying patch /usr/local/rvm/patches/ruby/ruby_2_3_gcc7.patch.
ruby-2.3.4 - #applying patch /usr/local/rvm/patches/ruby/2.3.4/fix_rb_thread_fd_close.patch.
ruby-2.3.4 - #applying patch /usr/local/rvm/patches/ruby/2.3.4/random_c_using_NR_prefix.patch.
ruby-2.3.4 - #configuring..........................................................
ruby-2.3.4 - #post-configuration..
ruby-2.3.4 - #compiling.....................................................................................................................................................................................................................................................................................................................................
ruby-2.3.4 - #installing............................
ruby-2.3.4 - #making binaries executable..
ruby-2.3.4 - #downloading rubygems-3.0.3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 882k 100 882k 0 0 18.7M 0 --:--:-- --:--:-- --:--:-- 18.7M
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.3.4 - #extracting rubygems-3.0.3.....
ruby-2.3.4 - #removing old rubygems........
ruby-2.3.4 - #installing rubygems-3.0.3...................................
ruby-2.3.4 - #gemset created /usr/local/rvm/gems/ruby-2.3.4@global
ruby-2.3.4 - #importing gemset /usr/local/rvm/gemsets/global.gems................................................................
ruby-2.3.4 - #generating global wrappers.......
ruby-2.3.4 - #gemset created /usr/local/rvm/gems/ruby-2.3.4
ruby-2.3.4 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.4 - #generating default wrappers.......
ruby-2.3.4 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.4 - #complete
Please be aware that you just installed a ruby that requires 3 patches just to be compiled on an up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to ruby-2.6.3 which will have all of the latest security patches.
Ruby was built without documentation, to build it run: rvm docs generate-ri
yes: standard output: Broken pipe
yes: write error
+ rvm --default use 2.3.4
+ typeset result current_result
+ rvm_ruby_args=()
+ __rvm_teardown_if_broken
+ __function_on_stack __rvm_load_project_config
+ __rvm_string_includes '__function_on_stack __rvm_teardown_if_broken rvm main' __rvm_load_project_config
+ typeset __search '__text=__function_on_stack __rvm_teardown_if_broken rvm main'
+ shift
+ for __search in '\"$@\"'
+ [[ __function_on_stack __rvm_teardown_if_broken rvm main == *\\ \\_\\_\\r\\v\\m\\_\\l\\o\\a\\d\\_\\p\\r\\o\\j\\e\\c\\t\\_\\c\\o\\n\\f\\i\\g\\ * ]]
+ return 1
+ return 1
+ __function_on_stack __rvm_with
+ __rvm_string_includes '__function_on_stack __rvm_teardown_if_broken rvm main' __rvm_with
+ typeset __search '__text=__function_on_stack __rvm_teardown_if_broken rvm main'
+ shift
+ for __search in '\"$@\"'
+ [[ __function_on_stack __rvm_teardown_if_broken rvm main == *\\ \\_\\_\\r\\v\\m\\_\\w\\i\\t\\h\\ * ]]
+ return 1
+ return 1
+ (( 0 > 0 ))
+ __rvm_cli_posix_check
+ __rvm_has_opt posix
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n 4.2.46(2)-release ]]
+ [[ :braceexpand:errexit:hashall:interactive-comments:nounset:pipefail:xtrace: == *\\:\\p\\o\\s\\i\\x\\:* ]]
+ return 1
+ __rvm_cli_load_rvmrc
+ (( 0 == 0 ))
+ [[ -n '' ]]
++ umask
+ export rvm_stored_umask=0022
+ rvm_stored_umask=0022
+ rvm_rvmrc_files=(\"/etc/rvmrc\" \"$HOME/.rvmrc\")
+ [[ -n /usr/local ]]
+ [[ ! /root/.rvmrc -ef /usr/local/.rvmrc ]]
+ rvm_rvmrc_files+=(\"${rvm_prefix}/.rvmrc\")
+ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
+ [[ -f /etc/rvmrc ]]
+ __rvm_grep '^\\s*rvm .*$' /etc/rvmrc
+ source /etc/rvmrc
++ umask u=rwx,g=rwx,o=rx
+ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
+ [[ -f /root/.rvmrc ]]
+ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
+ [[ -f /usr/local/.rvmrc ]]
+ unset rvm_rvmrc_files
+ __rvm_cli_version_check --default use 2.3.4
+ typeset disk_version
++ __rvm_version_installed
+++ command cat /usr/local/rvm/VERSION
+++ cat /usr/local/rvm/VERSION
+++ command cat /usr/local/rvm/RELEASE
++ echo '1.29.8 (latest)'
+ disk_version='1.29.8 (latest)'
+ [[ -s /usr/local/rvm/VERSION ]]
+ [[ 1.29.8 (latest) != \\1\\.\\2\\9\\.\\8\\ \\(\\l\\a\\t\\e\\s\\t\\) ]]
+ __rvm_initialize
+ true /usr/local/rvm/scripts
+ export rvm_scripts_path
+ source /usr/local/rvm/scripts/base
++ __rvm_has_opt errexit
++ [[ -n '' ]]
++ [[ -n '' ]]
++ [[ -n 4.2.46(2)-release ]]
++ [[ :braceexpand:errexit:hashall:interactive-comments:nounset:pipefail:xtrace: == *\\:\\e\\r\\r\\e\\x\\i\\t\\:* ]]
++ rvm_stored_errexit=1
++ set +e
++ (( 0 == 1 ))
++ export __array_start rvm_path
++ [[ -n '' ]]
++ __array_start=0
++ (( 0 == 0 ))
++ [[ -n 0022 ]]
++ rvm_rvmrc_files=(\"/etc/rvmrc\" \"$HOME/.rvmrc\")
++ [[ -n /usr/local ]]
++ [[ /root/.rvmrc -ef /usr/local/.rvmrc ]]
++ rvm_rvmrc_files+=(\"${rvm_prefix}/.rvmrc\")
++ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
++ [[ -f /etc/rvmrc ]]
++ GREP_OPTIONS=
++ command grep '^\\s*rvm .*$' /etc/rvmrc
++ source /etc/rvmrc
+++ umask u=rwx,g=rwx,o=rx
++ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
++ [[ -f /root/.rvmrc ]]
++ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
++ [[ -f /usr/local/.rvmrc ]]
++ unset rvm_rvmrc_files
++ export rvm_path
++ [[ -z /usr/local/rvm ]]
++ true /usr/local/rvm/scripts
++ load_rvm_scripts
++ typeset -a scripts
++ scripts=(selector logging support utility init cleanup env rvmrc install environment gemset checksum list)
++ source /usr/local/rvm/scripts/initialize
+++ [[ -n 4.2.46(2)-release ]]
+++ shopt -s extglob
+++ (( 0 == 1 ))
+++ export __rvm_env_loaded
+++ : __rvm_env_loaded:0:
+++ : __rvm_env_loaded:1:
+++ [[ -z '' ]]
+++ typeset -f __rvm_cleanse_variables
+++ __rvm_cleanse_variables
+++ __rvm_unset_ruby_variables
+++ unset rvm_env_string rvm_ruby_string rvm_ruby_strings rvm_ruby_binary rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_log_path rvm_ruby_major_version rvm_ruby_minor_version rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_repo_branch rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_tag rvm_ruby_version rvm_head_flag rvm_ruby_package_file rvm_ruby_configure rvm_ruby_name rvm_ruby_url rvm_ruby_global_gems_path rvm_ruby_args rvm_ruby_name rvm_llvm_flag rvm_ruby_repo_tag
+++ __rvm_load_rvmrc
+++ typeset _file
+++ typeset -a rvm_rvmrc_files
+++ (( 0 == 1 ))
+++ [[ -n 0022 ]]
+++ rvm_rvmrc_files=(\"/etc/rvmrc\" \"$HOME/.rvmrc\")
+++ [[ -n /usr/local ]]
+++ [[ /root/.rvmrc -ef /usr/local/.rvmrc ]]
+++ rvm_rvmrc_files+=(\"${rvm_prefix}/.rvmrc\")
+++ for _file in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -s /etc/rvmrc ]]
+++ __rvm_grep '^\\s*rvm .*$' /etc/rvmrc
+++ source /etc/rvmrc
++++ umask u=rwx,g=rwx,o=rx
+++ for _file in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -s /root/.rvmrc ]]
+++ for _file in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -s /usr/local/.rvmrc ]]
+++ return 0
+++ [[ 0 -eq 1 ]]
+++ unset rvm_gemset_name
+++ unset rvm_configure_flags rvm_patch_names rvm_make_flags
+++ unset rvm_env_string rvm_ruby_string rvm_action rvm_error_message rvm_force_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_json_flag rvm_yaml_flag rvm_file_name rvm_user_flag rvm_system_flag rvm_install_flag rvm_llvm_flag rvm_sticky_flag rvm_rvmrc_flag rvm_gems_flag rvm_docs_flag rvm_ruby_alias rvm_static_flag rvm_archive_extension rvm_hook rvm_ruby_name rvm_remote_flag
+++ __rvm_load_rvmrc
+++ typeset _file
+++ typeset -a rvm_rvmrc_files
+++ (( 0 == 1 ))
+++ [[ -n 0022 ]]
+++ rvm_rvmrc_files=(\"/etc/rvmrc\" \"$HOME/.rvmrc\")
+++ [[ -n /usr/local ]]
+++ [[ /root/.rvmrc -ef /usr/local/.rvmrc ]]
+++ rvm_rvmrc_files+=(\"${rvm_prefix}/.rvmrc\")
+++ for _file in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -s /etc/rvmrc ]]
+++ __rvm_grep '^\\s*rvm .*$' /etc/rvmrc
+++ source /etc/rvmrc
++++ umask u=rwx,g=rwx,o=rx
+++ for _file in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -s /root/.rvmrc ]]
+++ for _file in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -s /usr/local/.rvmrc ]]
+++ return 0
+++ (( 0 == 0 ))
+++ [[ -n 0022 ]]
+++ rvm_rvmrc_files=(\"/etc/rvmrc\" \"$HOME/.rvmrc\")
+++ [[ -n /usr/local ]]
+++ [[ /root/.rvmrc -ef /usr/local/.rvmrc ]]
+++ rvm_rvmrc_files+=(\"${rvm_prefix}/.rvmrc\")
+++ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -f /etc/rvmrc ]]
+++ GREP_OPTIONS=
+++ command grep '^\\s*rvm .*$' /etc/rvmrc
+++ source /etc/rvmrc
++++ umask u=rwx,g=rwx,o=rx
+++ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -f /root/.rvmrc ]]
+++ for rvmrc in '\"${rvm_rvmrc_files[@]}\"'
+++ [[ -f /usr/local/.rvmrc ]]
+++ unset rvm_rvmrc_files
+++ export rvm_path
+++ [[ -z /usr/local/rvm ]]
+++ true /usr/local/rvm/scripts
+++ [[ -n '' ]]
+++ case \"$rvm_path\" in
+++ rvm_user_install_flag=0
+++ export rvm_user_install_flag
+++ : rvm_bin_path:/usr/local/rvm/bin rvm_man_path:/usr/local/rvm/share/man rvm_archives_path:/usr/local/rvm/archives rvm_docs_path:/usr/local/rvm/docs rvm_environments_path:/usr/local/rvm/environments rvm_examples_path:/usr/local/rvm/examples rvm_gems_path:/usr/local/rvm/gems rvm_gemsets_path:/usr/local/rvm/gemsets rvm_help_path:/usr/local/rvm/help rvm_docs_path:/usr/local/rvm/docs rvm_hooks_path:/usr/local/rvm/hooks rvm_lib_path:/usr/local/rvm/lib rvm_log_path:/usr/local/rvm/log rvm_patches_path:/usr/local/rvm/patches rvm_repos_path:/usr/local/rvm/repos rvm_rubies_path:/usr/local/rvm/rubies rvm_rubygems_path:/usr/local/rvm/rubygems rvm_src_path:/usr/local/rvm/src rvm_tmp_path:/usr/local/rvm/tmp rvm_user_path:/usr/local/rvm/user rvm_usr_path:/usr/local/rvm/usr rvm_wrappers_path:/usr/local/rvm/wrappers rvm_verbose_flag:0 rvm_debug_flag:0 rvm_gems_cache_path:/usr/local/rvm/gems/cache
+++ export rvm_action rvm_alias_expanded rvm_archive_extension rvm_archives_path rvm_bin_flag rvm_bin_path rvm_debug_flag rvm_default_flag rvm_delete_flag rvm_docs_path rvm_docs_type rvm_dump_environment_flag rvm_environments_path rvm_error_message rvm_examples_path rvm_expanding_aliases rvm_file_name rvm_gemdir_flag rvm_gems_cache_path rvm_gems_path rvm_gemset_name rvm_gemset_separator rvm_gemsets_path rvm_gemstone_package_file rvm_gemstone_url rvm_head_flag rvm_help_path rvm_docs_path rvm_hook rvm_hooks_path rvm_install_on_use_flag rvm_lib_path rvm_llvm_flag rvm_loaded_flag rvm_log_path rvm_niceness rvm_nightly_flag rvm_only_path_flag rvm_parse_break rvm_patch_original_pwd rvm_patches_path rvm_path rvm_pretty_print_flag rvm_proxy rvm_quiet_flag rvm_reload_flag rvm_remove_flag rvm_repos_path rvm_rubies_path rvm_ruby_alias rvm_ruby_args rvm_ruby_binary rvm_ruby_bits rvm_ruby_configure rvm_ruby_file rvm_ruby_gem_home rvm_ruby_gem_path rvm_ruby_global_gems_path rvm_ruby_home rvm_ruby_interpreter rvm_ruby_irbrc rvm_ruby_major_version rvm_ruby_make rvm_ruby_make_install rvm_ruby_minor_version rvm_ruby_mode rvm_ruby_name rvm_ruby_package_file rvm_ruby_package_name rvm_ruby_patch rvm_ruby_patch_level rvm_ruby_release_version rvm_ruby_repo_url rvm_ruby_revision rvm_ruby_selected_flag rvm_ruby_sha rvm_ruby_string rvm_ruby_strings rvm_ruby_tag rvm_ruby_url rvm_ruby_user_tag rvm_ruby_version rvm_script_name rvm_scripts_path rvm_sdk rvm_user_install_flag rvm_silent_flag rvm_src_path rvm_sticky_flag rvm_system_flag rvm_tmp_path rvm_token rvm_trace_flag rvm_use_flag rvm_user_flag rvm_user_path rvm_usr_path rvm_verbose_flag rvm_wrappers_path rvm_ruby_repo_branch rvm_man_path rvm_remote_flag rvm_ruby_repo_tag
++ for entry in '${scripts[@]}'
++ [[ == *\\ \\s\\e\\l\\e\\c\\t\\o\\r\\ * ]]
++ source /usr/local/rvm/scripts/functions/selector
+++ source /usr/local/rvm/scripts/functions/selector_gemsets
+++ source /usr/local/rvm/scripts/functions/selector_late
+++ source /usr/local/rvm/scripts/functions/selector_parse
+++ source /usr/local/rvm/scripts/functions/selector_interpreters
++ for entry in '${scripts[@]}'
++ [[ == *\\ \\l\\o\\g\\g\\i\\n\\g\\ * ]]
++ source /usr/local/rvm/scripts/functions/logging
+++ __rvm_set_colors
+++ case \"${TERM:-dumb}\" in
+++ rvm_error_clr=
+++ rvm_warn_clr=
+++ rvm_debug_clr=
+++ rvm_notify_clr=
+++ rvm_code_clr=
+++ rvm_comment_clr=
+++ rvm_reset_clr=
+++ exec
++ for entry in '${scripts[@]}'
++ [[ == *\\ \\s\\u\\p\\p\\o\\r\\t\\ * ]]
++ source /usr/local/rvm/scripts/functions/support
+++ [[ -n '' ]]
+++ __rvm_setup_utils_functions
+++ typeset gnu_tools_path gnu_prefix gnu_util
+++ typeset -a gnu_utils gnu_missing
+++ gnu_utils=(awk cp date find sed tail tar xargs)
+++ gnu_missing=()
/usr/local/rvm/scripts/functions/support: line 182: _system_name: unbound variable"]}

 amazon-ebs: to retry, use: --limit @/tmp/jenkins-9df2f531/workspace/official-base-ami-build_encrypted/ansible/packer-base-playbook-ng/site.retry
 amazon-ebs:
 amazon-ebs: PLAY RECAP *********************************************************************
 amazon-ebs: default : ok=3 changed=2 unreachable=0 failed=1
 amazon-ebs:
==> amazon-ebs: Cancelling the spot request...
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Cleaning up any extra volumes...
==> amazon-ebs: No volumes to clean up, skipping
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' errored: Error executing Ansible: Non-zero exit status: exit status 2
==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: Error executing Ansible: Non-zero exit status: exit status 2
==> Builds finished but no artifacts were created.
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment