ianhattendorf / autocomplete-ruby

Provides intelligent code completion for Ruby in the Atom editor. Requires RSense.
MIT License
51 stars 9 forks source link

Error starting rsense #34

Closed ldmplus closed 7 years ago

ldmplus commented 7 years ago

When the atom is started, it appears: autocomplete-ruby: exec error: Error: Command failed: /Users/v/.rvm/gems/ruby-2.3.3/bin/rsense start --port 47367 --path /Users/v/Downloads/ApiServer env: ruby_executable_hooks: No such file or directory (You might need to set the rsense path, see the readme)

But the above command can be excuted in CMD.

stevemeisner commented 7 years ago

I am having the same issue. Also using RVM. Also can run the command with no errors.

I am also using atom-project-shell-env which seems to be correctly mapping the location (as the error shows the correct path without putting it in the rsense settings).

I imagine that I'm not doing something right... help? :-)

stevemeisner commented 7 years ago

I've got it working!

In the settings, instead of

/Users/username/.rvm/gems/ruby-2.3.3/bin/rsense

i changed it to

~/.rvm/gems/ruby-2.3.3/bin/rsense

and it worked!

ianhattendorf commented 7 years ago

I'm confused, ~ is a substitution for /Users/username assuming you're logged in as username. Could you try setting it back to /Users/{your_username}/.rvm/gems/ruby-2.3.3/bin/rsense and running again?

Also, are you launching from the icon, or from your terminal by running atom? I've noticed some issues where the environment isn't configured correctly when launching from the icon but is fine when launching from the terminal. If it works fine when launching via the terminal (executing atom) but not when you click the icon, then there's an issue with your environment configuration.

turnspike commented 7 years ago

I'm also having this issue under zsh/chruby. Atom seems to inconsistently use gem locations for autocomplete-ruby.

Workaround:

  1. Atom>Prefs>Autocomplete, set Rsense path to a specific chruby/rsense location: /Users/work/.gem/ruby/2.2.3/bin/rsense
  2. Terminal, cd to project folder then: chruby ruby-2.2.3; atom .

For RVM, I imagine that just launching atom from the terminal in the desired project folder could also work.

It is perhaps related to this core bug: https://github.com/atom/atom/issues/4126

stevemeisner commented 7 years ago

@ianhattendorf I'm not entirely sure why, either. :-/ I had just tried it in desperation.

I presumed it had something to do with using RVM and the more relative pointer somehow made magic... (not really, but it did work...)

I do launch from the CL using atom . in the project dir.

I'm a little embarrassed right now, as I did put a little time into troubleshooting a very real issue that I was having. But now that I'm going back and trying:

/Users/stevemeisner/.rvm/gems/ruby-2.4.1/bin/rsense (// which rsense)

...for the path in the settings, I am getting no errors. I also just removed the custom path from the settings, and the default also worked. I restarted Atom between each test.

Initially, I did have the same issue as @Sooyung. I suppose my PR isn't relevant after all. But now I'm not sure what fixed my issue.

ianhattendorf commented 7 years ago

Yep, looks like the atom issue @turnspike mentioned is the root cause for this issue. Unfortunately there isn't much we can do on our end if the environment isn't configured correctly, so we'll need to wait for a fix in atom.

I'll go ahead and close this, if you have any other issues feel free to reply or open a new issue.

stevemeisner commented 7 years ago

Thanks, @ianhattendorf for your attention and work here!

ldmplus commented 7 years ago

Thanks everyone.

blueacker commented 6 years ago

I also get this error message, and can't fix it by modifying rsense path. And I solved it by reinstalling autocomplete-ruby and autocomplete.

ghost commented 6 years ago

use wrappers as stated at: https://stackoverflow.com/questions/26247926/how-to-solve-usr-bin-env-ruby-executable-hooks-no-such-file-or-directory

use wrappers, example:

$ which jekyll

/path/to/rvm/gems/ruby-version/bin/jekyll

in the returned path replace bin with wrappers so you get:

/path/to/rvm/gems/ruby-version/wrappers/jekyll this is a script that will load proper environment and fix your problem, wrappers are generated automatically withing RVM.

Schwad commented 6 years ago

So, this is quite embarrassing, but I am going to post this here because I had the same problem.

I updated from Ruby 2.4.3 to Ruby 2.4.4 a while back. Didn't even think, realized that the reason I was getting this exact error is I didn't run gem install rsense again after the bump. so there you go, all fixed on my end.

hardyoyo commented 5 years ago

None of the above workarounds worked for me. I think I will just disable autocomplete-ruby so I don't have to dismiss this error message in Atom any more.