dgutov / robe

Code navigation, documentation lookup and completion for Ruby
584 stars 37 forks source link

LoadError: cannot load such file -- pry/doc #106

Closed lukertty closed 7 years ago

lukertty commented 7 years ago

I always get Cannot locate this method: require. Trygem-install pry-docto get access to Ruby Core documentation. when called robe-show-doc

And I tryed M-x inf-ruby-console-auto and run gem-install pry-doc, I get

[6] pry(main)> gem-install pry-doc
Gem `pry-doc` installed.
LoadError: cannot load such file -- pry/doc
from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `require'
[6] pry(main)> show-doc Kernel#require
Error: Cannot locate this method: require. Try `gem-install pry-doc` to get access to Ruby Core documentation.

However, when i run pry or rails console in terminal outside emacs, even in eshell, everything works fine.

[2] pry(main)> gem-install pry-doc
Gem `pry-doc` installed.
[3] pry(main)> show-doc Kernel#require

From: load.c (C Method):
Owner: Kernel
Visibility: private
Signature: require(arg1)
Number of lines: 29
....

Environment

macOS 10.11.6 Emacs 25.2 Pry version 0.10.4 on Ruby 2.4.1 Rails 5.1.3 Gemfile:

gem 'pry-rails', :group => :development

Any Ideas?

lukertty commented 7 years ago

After I create this issue and restart Emacs, everything works fine... Dont know why...

dgutov commented 7 years ago

pry-doc should be in Gemfile.

ylluminarious commented 6 years ago

Adding pry-doc to the Gemfile does indeed work. Alternatively, pry-doc and the other dependencies can be added to the .gemspec file instead. E.g.:

spec.add_development_dependency "pry", "~> 0.10.3"
spec.add_development_dependency "pry-doc", ">= 0.8.0"
spec.add_development_dependency "method_source", ">= 0.8.2"