lukechilds / zsh-nvm

Zsh plugin for installing, updating and loading nvm
MIT License
2.22k stars 112 forks source link

Not working with rails command #73

Closed fffx closed 3 years ago

fffx commented 3 years ago

Rails expect node to be an executable file, but before nvm initialization node is a bash function

https://github.com/rails/execjs/blob/master/lib/execjs/external_runtime.rb#L132

commands.find { |cmd|
          if File.executable? cmd
            cmd
          else
            path = ENV['PATH'].split(File::PATH_SEPARATOR).find { |p|
              full_path = File.join(p, cmd)
              File.executable?(full_path) && File.file?(full_path)
            }
            path && File.expand_path(cmd, path)
          end
        }
fffx commented 3 years ago

Sorry, I should read the full documentation, add NVM_LAZY_LOAD_EXTRA_COMMANDS=('rails') works.