lukechilds/zsh-nvm

Not working with rails command

fffx opened this issue · 1 comments

fffx commented

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

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