Skip to content

[bug] Macos Sequoia 15.2 error installing CRuby sources: sh: etags: command not found #135

@tlubz

Description

@tlubz

When installing CRuby sources in pry, I get this error:

[2] pry(main)> require 'pry-doc'
=> true
[3] pry(main)> show-method Time.new
Identifier not found - do you want to install CRuby sources to attempt to resolve the identifier there?
This allows the lookup of C internals Y/N y
Downloading and setting up Ruby 3_2_5 source...
  % 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 15.0M    0 15.0M    0     0  2553k      0 --:--:--  0:00:06 --:--:-- 2896k
Generating tagfile!
sh: etags: command not found
Error: find . -type f -name '*.[chy]' | etags - --no-members

digging into this, lib/pry-doc/pry_ext/show_source_with_c_internals/ruby_source_installer.rb:35 has this line:

self.etag_binary = linux? ? File.join(PryDoc.root, "libexec/linux/etags-#{arch}") : "etags"

in this case, it looks like it assumes that the etags binary is installed globally. however it does not appear to be shipped with macos.

I was able to get it working by installing Emacs with brew install emacs, but I don't think pry-doc should depend on a big distro like that. On macos, a descriptive error message, documentation, or other way to pull in the dependency would be preferable to the command not found error.

Also i'm not sure that emacs is the best way to get the etags binary. If there's a better source for macos, that would be preferable.

Platform: macos version 15.2
Ruby 3.2.6
pry-0.14.2
pry-doc-1.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions