Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open load file: no such file or directory, gtags #67

Closed
bmag opened this issue Oct 2, 2015 · 5 comments
Closed

Cannot open load file: no such file or directory, gtags #67

bmag opened this issue Oct 2, 2015 · 5 comments
Labels

Comments

@bmag
Copy link

bmag commented Oct 2, 2015

Reproduction recipe:
With Emacs 24.5, the following ~/.emacs.d/init.el file and no other files in ~/.emacs.d directory:

;;; ~/.emacs.d/init.el
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(package-initialize)
    1. start emacs
    1. M-x package-install RET helm-gtags RET
    1. M-x package-install RET drupal-mode RET
    1. restart emacs
    1. M-: (require 'helm-gtags)
    1. M-: (require 'drupal-mode)

Result: An error with this backtrace:

Debugger entered--Lisp error: (file-error "Cannot open load file" "no such file or directory" "gtags")
  require(gtags)
  eval-buffer(#<buffer  *load*> nil "/home/bar/.emacs.d/elpa/drupal-mode-20150830.1227/drupal/gtags.el" nil t)  ; Reading at buffer position 916
  load-with-code-conversion("/home/bar/.emacs.d/elpa/drupal-mode-20150830.1227/drupal/gtags.el" "/home/bar/.emacs.d/elpa/drupal-mode-20150830.1227/drupal/gtags.el" nil t)
  require(drupal/gtags)
  #[nil "\300\301!\207" [require drupal/gtags] 2]()
  eval-after-load(helm-gtags #[nil "\300\301!\207" [require drupal/gtags] 2])
  byte-code("\306�  \n�\f%\307�\211�.\2031

I also get the error "Cannot open load file: no such file or directory, gtags" (without the backtrace) when opening a directory with Dired (e.g. via C-x d).

@kostajh
Copy link

kostajh commented Oct 2, 2015

Try a M-: (require 'gtags).

I have a use-package statement in my configuration:

  (use-package gtags
    :ensure t
    :defer t)

@bmag
Copy link
Author

bmag commented Oct 2, 2015

@kostajh your suggestion didn't work, but it did help. Turns out gtags package is only available from Marmalade, but I didn't have Marmalade in package-archives. However, I checked and installing drupal-mode and helm-gtags doesn't automatically install gtags.
To summarize: drupal-mode assumes that if drupal-mode and helm-gtags are installed, then gtags is also installed and tries to require it. However, the assumption is wrong and causes the error above.

@arnested arnested added the Bug label Oct 4, 2015
@arnested
Copy link
Owner

arnested commented Oct 4, 2015

Yeah. The assumption about gtags being available is wrong.

I tried to solve this - see the feature/helm-gtags branch. I haven't put much effort into it so it might be a bit naïve and/or rough around the edges.

If someone could have a look and provide feedback I'll be grateful.

The only change is the addtion of a dedicated drupal/helm-gtags.el instead of relying on drupal/gtags.el.

@jmjoy
Copy link

jmjoy commented Mar 20, 2016

I also meet this problem on Windows. Because the emacs on Windows lose gtags.el, so you can just copy the gtags.el to a load-path. This gtags.el is from GNU Global source.
gtags.zip

arnested added a commit that referenced this issue Mar 20, 2016
@arnested
Copy link
Owner

I just made a few adaptions to the feature/helm-gtags branch and merged it to develop.

@bmag, let me know if this works or breaks something for you.

@jmjoy, I'm not sure this is related to what you experience. Your problem seems related to the standard gtags -- and that should not break anything if it is not installed. Feel free to open a new issue with more details and we'll see if we can figure out what's happening for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants