rvm / rvm

Ruby enVironment Manager (RVM)
https://rvm.io
Other
5.11k stars 1.02k forks source link

errors when using Darwin and Homebrew awk #3900

Closed sverasch closed 7 years ago

sverasch commented 7 years ago

Description

If a Darwin system has a separate awk installed, depending on the PATH load order, rvm will output an error of

awk: illegal statement source line number 1

Steps to reproduce

  1. install rvm
  2. install homebrew
  3. brew install awk
  4. change path to load brew binaries first or
  5. PATH=/usr/local/bin:$PATH source ~/.rvm/scripts/rvm

Expected behavior

No awk errors appear when sourcing rvm file, or run rvm info

Actual behavior

Awk errors appear

Environment info

rvm info awk: illegal statement source line number 1 Warning! PATH is not properly set up, '/Users/sverasch/.rvm/gems/ruby-2.3.3/bin' is not at first place, usually this is caused by shell initialization files - check them for 'PATH=...' entries, it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-2.3.3'. awk: illegal statement source line number 1 awk: illegal statement source line number 1

ruby-2.3.3:

system: uname: "Darwin res-mpa1b 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64" system: "osx//x86_64" bash: "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)" zsh: "/usr/local/bin/zsh => zsh 5.2 (x86_64-apple-darwin14.5.0)"

rvm: version: "rvm 1.28.0 (latest) by Wayne E. Seguin wayneeseguin@gmail.com, Michal Papis mpapis@gmail.com [https://rvm.io/]" updated: "12 days 17 hours 45 minutes 26 seconds ago" path: "/Users/sverasch/.rvm" awk: illegal statement source line number 1 awk: illegal statement source line number 1

ruby: interpreter: "" version: "" date: "2016-11-21" platform: "x86_64-darwin15" patchlevel: "2016-11-21 revision 56859" full_version: "ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]"

homes: gem: "/Users/sverasch/.rvm/gems/ruby-2.3.3" ruby: "/Users/sverasch/.rvm/rubies/ruby-2.3.3"

binaries: ruby: "/Users/sverasch/.rvm/rubies/ruby-2.3.3/bin/ruby" irb: "/Users/sverasch/.rvm/rubies/ruby-2.3.3/bin/irb" gem: "/Users/sverasch/.rvm/rubies/ruby-2.3.3/bin/gem" rake: "/Users/sverasch/.rvm/gems/ruby-2.3.3/bin/rake"

environment: PATH: "/usr/local/bin:/usr/local/sbin:/Users/sverasch/.rvm/gems/ruby-2.3.3/bin:/Users/sverasch/.rvm/gems/ruby-2.3.3@global/bin:/Users/sverasch/.rvm/rubies/ruby-2.3.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/sverasch/.rvm/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/Users/sverasch/.rvm/bin" GEM_HOME: "/Users/sverasch/.rvm/gems/ruby-2.3.3" GEM_PATH: "/Users/sverasch/.rvm/gems/ruby-2.3.3:/Users/sverasch/.rvm/gems/ruby-2.3.3@global" MY_RUBY_HOME: "/Users/sverasch/.rvm/rubies/ruby-2.3.3" IRBRC: "/Users/sverasch/.rvm/rubies/ruby-2.3.3/.irbrc" RUBYOPT: "" gemset: ""

sverasch commented 7 years ago

I fixed this by using the full path in scripts/functions/detect_system, however __rvm_awk variable needs to be changed as well for rvm info to work correctly

mpapis commented 7 years ago

@sverasch please gist rvm --trace info

mpapis commented 7 years ago

Closing as there was no feedback in over 2 weeks, please feel free to reopen when you can provide the requested information.