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

Warning and Message when opening a ruby file #4098

Closed
gguimaraesbr opened this issue Dec 7, 2015 · 9 comments
Closed

Warning and Message when opening a ruby file #4098

gguimaraesbr opened this issue Dec 7, 2015 · 9 comments

Comments

@gguimaraesbr
Copy link

It happens everytime I open a ruby file:

Warning:
Error (use-package): enh-ruby-mode :config: Symbol's function definition is void: sp-with-modes

Message:
Suspicious state from syntax checker ruby: Checker ruby returned non-zero exit code 1, but no errors from output: ruby: no Ruby script found in input (LoadError) Checker definition probably flawed.

Any idea?

@bmag
Copy link
Collaborator

bmag commented Dec 7, 2015

The warning probably means that a hook in enh-ruby-mode-hook assumes that smartparens is loaded when smartparens isn't loaded, or maybe the function sp-with-mdoes was removed upstream.
It will be easier to help if we know what version of spacemacs you are using. Please paste the output of SPC h d s.

The other message has to do with Flycheck encountering some errors. I don't know Ruby, but Flycheck (the package that provides syntax checking) has some commands for detecting errors. Try hitting SPC e v (bound to flycheck-verify-setup), maybe its output will be useful.

@wamaral
Copy link

wamaral commented Dec 7, 2015

I can replicate the sp-with-modes ruby issue, here's the output of SPC h d s:

System Info

  • OS: gnu/linux
  • Emacs: 24.5.1
  • Spacemacs: 0.104.6
  • Spacemacs branch: master (rev. 50ec30b)
  • Distribution: spacemacs
  • Layers:
((auto-completion :variables auto-completion-enable-sort-by-usage t auto-completion-enable-snippets-in-popup t)
 clojure colors common-lisp emacs-lisp evil-commentary extra-langs eyebrowse git github gtags
 (haskell :variables haskell-enable-ghc-mod-support t haskell-enable-ghci-ng-support t)
 html java javascript markdown
 (org :variables org-enable-github-support t)
 puppet racket react restclient ruby ruby-on-rails scala scheme search-engine semantic
 (shell :variables shell-default-term-shell "/bin/bash" shell-default-height 30 shell-default-position 'bottom)
 shell-scripts spell-checking
 (syntax-checking :variables syntax-checking-enable-tooltips nil)
 sql themes-megapack unimpaired version-control yaml)

@gguimaraesbr
Copy link
Author

Here is mine:

System Info

  • OS: darwin
  • Emacs: 24.5.1
  • Spacemacs: 0.104.6
  • Spacemacs branch: master (rev. 50ec30b)
  • Distribution: spacemacs
  • Layers:
(auto-completion emacs-lisp git html javascript markdown org osx python ruby
                 (shell :variables shell-default-shell 'ansi-term shell-default-term-shell "/usr/local/bin/zsh" shell-default-height 30 shell-default-position 'bottom)
                 syntax-checking)

Hitting SPC e v gives the following output:

Syntax checkers for buffer sysint.rb in enh-ruby-mode:

  chef-foodcritic
    - predicate:  nil
    - executable: Not found

  ruby-rubocop
    - predicate:  nil
    - executable: Not found

  ruby-rubylint
    - predicate:  nil
    - executable: Not found

  ruby
    - predicate:  t
    - executable: Found at /Users/guilhermefilho/.rbenv/shims/ruby

  ruby-jruby
    - predicate:  nil
    - executable: Not found

Flycheck Mode is enabled.

@wamaral
Copy link

wamaral commented Dec 8, 2015

Here's my SPC e v:

Syntax checkers for buffer product_test.rb in enh-ruby-mode:

  chef-foodcritic
    - predicate:  nil
    - executable: Not found

  ruby-rubocop
    - predicate:  t
    - executable: Found at /usr/local/bin/rubocop

  ruby-rubylint
    - predicate:  nil
    - executable: Not found

  ruby
    - predicate:  t
    - executable: Found at /usr/bin/ruby

  ruby-jruby
    - predicate:  nil
    - executable: Not found

Flycheck Mode is enabled.

@kevincolyar
Copy link

Same issue here opening ruby files via terminal emacs:

Error (use-package): enh-ruby-mode :config: Symbol's function definition is void: sp-with-modes
#### System Info
- OS: darwin
- Emacs: 24.5.1
- Spacemacs: 0.104.6
- Spacemacs branch: master (rev. 50ec30b)
- Distribution: spacemacs
- Layers:
```elisp
(auto-completion better-defaults git version-control syntax-checking wakatime osx markdown clojure html javascript ranger ruby ruby-on-rails yaml python shell shell-scripts restclient dash
                 (org :variables org-enable-github-support t))

@bmag
Copy link
Collaborator

bmag commented Dec 10, 2015

The Symbol's function definition is void: sp-with-modes error is caused because the Ruby layer tries to call this function before smartparens is loaded. I submitted a PR to fix it in develop - #4132. I don't use Ruby myself, does any of you run on develop sometimes and can test it?

About the other issue, Spacemacs uses Flycheck for the syntax checking functionality. Flycheck checks the syntax by running an external checker and checking its return code and output. IIRC Flycheck expects the checker to produce some error output when returning a non-zero return code. In @gguimaraesbr's case the checker didn't print any errors. If I understand the message correctly, the output of the checker was "no Ruby script found in input (LoadError)".

@gguimaraesbr according to your SPC e v, your checker is ruby. You can run SPC e h ruby to get some information about it. Here is part of the description for the ruby checker:

Please note that the output of different Ruby versions and
implementations varies wildly. This syntax checker supports
current versions of MRI and JRuby, but may break when used with
other implementations or future versions of these
implementations.

Please consider using ruby-rubocop' orruby-rubylint' instead.

So I guess you should install rubocop or rubylint.

I don't use Ruby myself, so I can't really help you much more. If you want to look further into this problem you should check out http://www.flycheck.org/resources.html and Flycheck questions in stackoverflow and https://emacs.stackexchange.com.

@wamaral I see you have rubocop. Does syntax checking work for you, or do you get the same "Suspicious state" message?

@wamaral
Copy link

wamaral commented Dec 10, 2015

@bmag syntax checking, as well as linting, works perfectly for me with rubocop.

I will check out the develop branch later today and report back.

@gguimaraesbr
Copy link
Author

@bmag Installing rubocop and running on develop solved both issues. Thank you!

@wamaral
Copy link

wamaral commented Dec 11, 2015

I can confirm, no errors shown while using the develop branch. Thanks!

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

No branches or pull requests

5 participants