edubkendo / atom-racer

Intelligent code completion for Rust in the Atom Editor. Requires Racer.
MIT License
115 stars 24 forks source link

Uncaught Error: spawn EACCES #18

Closed KingOfThePirates closed 9 years ago

KingOfThePirates commented 9 years ago

[Enter steps to reproduce below:]

  1. open rust code
  2. type in the editor

Atom Version: 0.187.0 System: linux 3.13.0-37-generic Thrown From: racer package, v0.9.1

Stack Trace

Uncaught Error: spawn EACCES

At child_process.js:1160

Error: spawn EACCES
  at exports._errnoException (util.js:753:11)
  at ChildProcess.spawn (child_process.js:1160:11)
  at Object.exports.spawn (child_process.js:993:9)
  at new BufferedProcess (/usr/share/atom/resources/app/src/buffered-process.js:51:37)
  at /home/andrew/.atom/packages/racer/lib/racer-client.coffee:41:21
  at /usr/share/atom/resources/app/node_modules/temp/lib/temp.js:252:7
  at FSReqWrap.oncomplete (fs.js:100:15)

Commands

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "base16-tomorrow-dark-theme"
    ]
  },
  "racer": {
    "racerBinPath": "/home/andrew/.atom/packages/racer",
    "rustSrcPath": "/usr/local/share/doc/rust/html/src/core"
  }
}

Installed Packages

# User
autocomplete-plus, v2.6.0
color-picker, v1.5.0
language-rust, v0.4.2
linter, v0.12.0
linter-jshint, v0.1.0
linter-rust, v0.0.7
minimap, v4.6.0
racer, v0.9.1

# Dev
No dev packages
alkama commented 9 years ago

The values you put in the plugin settings are completely wrong :)

"racerBinPath" is not correct

(it's titled 'Path to the Racer executable' in the settings):

What we request here is not the path to our plugin folder, but the path to the "racer" executable (which you can compile yourself from https://github.com/phildawes/racer). So it's the full path to a program executable that we expect here !

"rustSrcPath" is not correct either

(it's titled 'Path to the Rust source code directory' in the settings):

What we request here is the path to the SOURCE CODE of rustc, not the html documentation but the actual source code. You can either download the nightly tar of the source using https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz or clone the git repository https://github.com/rust-lang/rust and then point to the "src" subdirectory that both of those options will generate.

Once your corrected those steps, it should work.

Have fun !

KingOfThePirates commented 9 years ago

Thank you, one more problem: the rust source code path. I did nothing but the basic install with curl -L https://static.rust-lang.org/rustup.sh | sudo sh. I cannot find it.

Edit: my bad didn't see your edit. You're a boss.

alkama commented 9 years ago

You're welcome :) Good rusting !

KingOfThePirates commented 9 years ago

It works :) I'm so happy, and you're awesome!!

And for other complete beginners- restart your editor to get the changes working.

alkama commented 9 years ago

excellent !

skariel commented 9 years ago

I'm getting the same issue but my paths are correct:

Atom Version: 0.190.0 System: Mac OS X 10.10.2 Thrown From: racer package, v0.9.1

Stack Trace

Uncaught Error: spawn EACCES

At child_process.js:1145

Error: spawn EACCES
  at exports._errnoException (util.js:734:11)
  at ChildProcess.spawn (child_process.js:1145:11)
  at Object.exports.spawn (child_process.js:977:9)
  at new BufferedProcess (/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:51:37)
  at /Users/skariel/.atom/packages/racer/lib/racer-client.coffee:41:21
  at /Applications/Atom.app/Contents/Resources/app/node_modules/temp/lib/temp.js:252:7
  at FSReqWrap.oncomplete (fs.js:77:15)

Commands

     -4:14.5 application:open (atom-text-editor.editor)
 14x -2:04.9 core:backspace (atom-text-editor.editor.is-focused)
     -1:27.5 command-palette:toggle (atom-text-editor.editor.is-focused)
     -1:22.8 application:open-your-config (atom-text-editor.editor.is-focused)
     -0:17.1 core:backspace (atom-text-editor.editor)
     -0:16.6 core:move-up (atom-text-editor.editor)
 14x -0:16.4 core:move-right (atom-text-editor.editor)
     -0:14.0 core:backspace (atom-text-editor.editor)
  2x -0:12.9 core:save (atom-text-editor.editor)
     -0:01.0 core:backspace (atom-text-editor.editor.is-focused)

Config

{
  "racer": {
    "racerBinPath": "/Users/skariel/racer/target/release",
    "rustSrcPath": "/Users/skariel/rust/src"
  }
}

Installed Packages

# User
autocomplete-plus, v2.9.0
language-rust, v0.4.3
linter, v0.12.0
linter-rust, v0.0.8
racer, v0.9.1

# Dev
No dev packages
alkama commented 9 years ago

"/Users/skariel/racer/target/release"

is "release" the executable? if not, see https://github.com/edubkendo/atom-racer/issues/18#issuecomment-85703916 and reread the first paragraph.

It's the path to the executable, including the actual name of the executable, as the exemple shows (when it's empty) by providing /usr/local/bin/racer (notice the "racer" there, it's not a folder)

skariel commented 9 years ago

yep, I didn't include the executable name, working now

thanks!

alkama commented 9 years ago

you're welcome :) happy coding !