atom-racer icon indicating copy to clipboard operation
atom-racer copied to clipboard

racer.racerBinPath is not set, but it actually is!

Open NobbZ opened this issue 9 years ago • 19 comments

Stack Trace

racer.racerBinPath is not set in your config.

At undefined

undefined

Commands

     -3:56.4.0 snippets:expand (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:31.5.0 core:save (atom-text-editor.editor.is-focused)
     -0:29.7.0 snippets:next-tab-stop (atom-text-editor.editor.is-focused)
     -0:29.7.0 snippets:expand (atom-text-editor.editor.is-focused)
     -0:29.7.0 editor:indent (atom-text-editor.editor.is-focused)
     -0:27.1.0 core:save (atom-text-editor.editor.is-focused)
     -0:22.2.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)

Config

{
  "core": {},
  "editor": {
    "invisibles": {}
  }
}

Installed Packages

# User
language-cmake, v0.1.4
language-rust, v0.4.5
racer, v0.17.2

# Dev
No dev packages

racer-atom-binpathnotset

NobbZ avatar Nov 02 '15 18:11 NobbZ

I have these settings on linux with racer installed using the cargo install --git 'https://github.com/phildawes/racer.git' method.

I also git cloned the rust source as /usr/local/src/rust although since I installed rust from the binary, I don't understand why I'd have to have the rust compiler source just to use the tool. Maybe I'm not interpreting that right, or maybe it's necessary for the type definitions? (Obviously I'm new to rust) I wish that were explained more fully. (Couldn't there be a just the definitions subset of it?)

image

And even after restarting Atom I still get these when I type:

image

ghost avatar Nov 10 '15 03:11 ghost

:+1: for solving this . I am getting the same issue on ubuntu trusty with rustc binaries installed instead of compiling from source.

shahid-pk avatar Nov 13 '15 22:11 shahid-pk

Update : i solved my problem by compiling racer from source and by correcting racer binary and rust source paths in the package settings. Thanks a lot this works now :100:

shahid-pk avatar Nov 14 '15 00:11 shahid-pk

Had similar issues with an invalid path until I recognized a whitespace at the end of the line. Trimming the reference could perhaps prevent such mistake in the future. Moreover if the executable is not already in your PATH you have to add it yourself so atom can spawn an instance.

autarc avatar Nov 24 '15 18:11 autarc

Yes, I resolved this by upgrading atom v 1.2.4, adding export RUST_SRC_PATH=".../src/rust/src" to my .profile and logging out/in, and making sure that the racer bin path in atom was set to the full path of the racer binary and NO TILDE for home - that doesn't get expanded correctly for some reason.

Pain in the butt though. I had a very hard time figuring this out (because I'm stupid and/or because I'm new to linux and atom and rust and this dev ecosystem generally)

ghost avatar Nov 26 '15 17:11 ghost

As of Atom 1.6.1 it still doesn't work, racer alone in the terminal works just fine. Ubuntu 15.04.

victrcodes avatar Apr 01 '16 15:04 victrcodes

Don't set it to a path with ~/, use /home/user/ instead. This fixed it for me.

richarddewit avatar Apr 01 '16 19:04 richarddewit

@richarddewit I've set an absolute path - still doesn't work.

victrcodes avatar Apr 01 '16 19:04 victrcodes

@vrcod mind sharing what it's actually set to?

edubkendo avatar Apr 01 '16 21:04 edubkendo

@edubkendo as in absolute path? /home/username/.cargo/bin/racer for racer executable and /usr/local/src/rust/src for rust source dir.

victrcodes avatar Apr 05 '16 13:04 victrcodes

I found that it only works on Windows if you give it the full path to the binary, not just to the bin folder containing racer.exe. e.g. C:\Users\username\.cargo\bin\racer.exe works, but C:\Users\username\.cargo\bin does not.

The documentation (and the default path) seem to indicate that you only need to point it at the folder, which is either misleading or a bug on Windows.

TomGillen avatar Apr 30 '16 22:04 TomGillen

@TomGillen I am happy to make that more clear if you have any suggestions. Current wording:

Full path (including executable) of Racer's binary (e.g. /Users/me/racer/bin/racer or c:\racer\bin\racer.exe)

edubkendo avatar May 04 '16 14:05 edubkendo

I also noted something somewhat related to this now: If I don't set this setting at all, it refuses to try to use whatever I have in my path (and racer is actually in the path in my case). I think it should default to that.

@edubkendo - do you want me to file a separate issue about that? I could even go ahead and try to fix it, but I don't know how to set up a proper "dev environment" for Atom or anything.

perlun avatar Jun 23 '16 20:06 perlun

Just copy racer binary to folder that doesn't contain dots in it's path. It works for me. Sorry for my eng.

Maru1337 avatar Aug 04 '16 13:08 Maru1337

Hey @h3110w that doesn't work at all. I'm still getting errors I have the racer binary and rustfmt binary in a path that doesn't contain any dots.

jkbellew avatar Aug 10 '16 19:08 jkbellew

This is perhaps related to the use of rustup not installing source code? Which in Arch Linux is fixed by installing source by entering the following in terminal rustup component add rust-src and in Atom's racer settings Path to the Rust source code directory as /home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src

Not being able to locate the racer bin? In terminal cargo install racer and in race settings Path to the Racer executable as /home/username/.cargo/bin/racer

You'll also need to add the path to your src to fix non-zero exit code: 1 null . Again in terminal export RUST_SRC_PATH=$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/

bunnybooboo avatar Jan 15 '17 13:01 bunnybooboo

I am having this very same issue. I have set my rust source directory to /home/bryan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src

which does contain the rust srcs. Please get this fixed!

I keep seeing references to the .exe which is windows only. Is this really not compatible with *nix?

bryaan avatar Jan 24 '17 04:01 bryaan

I solved this issue by setting racerPath properly.

The path to Racer has to point to the Racer binary executable (this is NOT a directory we request here).

alscientist avatar Jan 28 '17 06:01 alscientist

I had the same issue.

To save others time, i just sum up the steps to configure racer correctly on Ubuntu 16.04:

  1. Install everything, which is requested in the installation section of the racer documentation.
  2. Build the source of Rust according to the guide at github. (By default this will be installed at Linux Ubuntu in the directory /home/user/rust.)
  3. Adjust settings of the Racer package in Atom /home/user/.cargo/bin/racer for racer executable /home/user/rust/src for rust source code directory
  4. restart Atom

tocto avatar Feb 26 '17 10:02 tocto