Ruby-build: NoMethodError: undefined method `path' for nil:NilClass

Created on 11 Apr 2020  路  5Comments  路  Source: rbenv/ruby-build

Trying to update rbenv list of ruby versions and get this error:

$ brew install rbenv
==> Installing dependencies for rbenv: ruby-build
==> Installing rbenv dependency: ruby-build
Error: An exception occurred within a child process:
  NoMethodError: undefined method `path' for nil:NilClass
Did you mean?  paths
  • MacOs Catalina 10.15.3 (19D76)
  • Xcode 10.2.1 Build version 10E1001
  • Homebrew 2.2.12

Most helpful comment

After running brew doctor I saw brew was complaining my Xcode version was outdated.

I have updated to

  • Xcode 11.4 Build version 11E146

Now the error has disappeared

Thanks for being attentive @jasonkarns ;)

All 5 comments

This is an issue with the home brew formula for rbenv, not ruby-build. Perhaps check out the homebrew/homebrew-core repo for open issues or homebrew鈥檚 discourse forum.

Hi @jasonkarns maybe my reproduction of the issue was confused, this is maybe more clear:

$ brew install ruby-build
Updating Homebrew...
Error: An exception occurred within a child process:
  NoMethodError: undefined method `path' for nil:NilClass
Did you mean?  paths

I am trying older versions of the formula but still same error:

$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/48f2c038a13b9b22ce15ea1e507158b61825864e/Formula/ruby-build.rb
Updating Homebrew...
Warning: Unsupported installation from a commit URL!
Consider using `brew extract ruby-build ...` instead!"
This will extract your desired ruby-build version to a stable tap instead of
installing from a commit URL that cannnot receive updates or fixes!

######################################################################## 100.0%
Warning: ruby-build 20200401 is available and more recent than version 20200224.
Error: An exception occurred within a child process:
  NoMethodError: undefined method `path' for nil:NilClass
Did you mean?  paths

Since the error is within Ruby, is there a chance that your brew itself is out of date?

After running brew doctor I saw brew was complaining my Xcode version was outdated.

I have updated to

  • Xcode 11.4 Build version 11E146

Now the error has disappeared

Thanks for being attentive @jasonkarns ;)

Was this page helpful?
0 / 5 - 0 ratings