ianhattendorf / autocomplete-ruby

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

Compatibility issues with Windows #17

Closed pseudoj closed 7 years ago

pseudoj commented 7 years ago

This package does not appear to be able to run on Windows 10 system. Specifically, it's having trouble looking for the home directory as '~' doesn't exist in Windows.

autocomplete-ruby: exec error: Error: Command failed: ~/.gem/ruby/2.3.0/bin/rsense stop
'~' is not recognized as an internal or external command,
operable program or batch file.

This can be reproduced by simply typing code.

I'm aware that it's all still pre-alpha, but I just wanted to bring this issue to attention.

ianhattendorf commented 7 years ago

To determine the gem directory, this plugin defaults to the value of the GEM_HOME environment variable or ~/.gem/ruby/2.3.0 if it isn't found. What is the state of ruby on windows right now? Is there a default spot we should look for gems?

As a workaround, you can set your rsensePath in the plugin's config to point to your gem dir.

philippneugebauer commented 7 years ago

Struggled for a similar reason with rbenv and MacOS, execute gem environment and take the EXECUTABLE DIRECTORY plus add rsense

mainrs commented 7 years ago

Looks like the gem directory in Windows has a different structure compared to linux. There is no bin folder.

philippneugebauer commented 7 years ago

http://stackoverflow.com/questions/10815328/ruby-gems-home-on-windows

Did you try it with that executable directory?

sumitag commented 7 years ago

setting GEM_HOME to ruby directory worked. But now I have

c:/ruby-2.2.6-x64/lib/ruby/gems/2.2.0/gems/rsense-0.5.18/lib/rsense/client/runner.rb:112:in `start': uninitialized constant Spoon::FileActions (NameError)
    from c:/ruby-2.2.6-x64/lib/ruby/gems/2.2.0/gems/rsense-0.5.18/bin/rsense:12:in `<top (required)>'
    from C:/ruby-2.2.6-x64/bin/rsense:23:in `load'
    from C:/ruby-2.2.6-x64/bin/rsense:23:in `<main>'
mainrs commented 7 years ago

@sumitag I am getting the same error. Would you mind posting your GEM_HOME?

sumitag commented 7 years ago

GEM_HOME = C:\ruby-2.2.6-x64 I have raised headius/spoon#21 for this

ianhattendorf commented 7 years ago

Those of you using Windows, if you have the time please try checking out the code from #19 and see if it auto detects the correct path.

mainrs commented 7 years ago

@ianhattendorf I'll check it out when I am home maybe in 5 hours :)

chenasraf commented 7 years ago

I updated my PR (#19) about the subject, but it still needs Windows verification/improvement. Anyone who is available to check it out please do! :)

elliotcm commented 7 years ago

@sumitag @ianhattendorf Regarding the Spoon::FileActions issue, it looks like they tried to fix it in 0.0.5 of Spoon (they're currently on 0.0.6): https://github.com/headius/spoon/issues/17#issuecomment-244975987

but I'm on 0.0.6 and experiencing the same issue. I'm an OSX user primarily so it doesn't bother me directly, but let me know if you need branches testing on Windows.

ahrherrera commented 7 years ago

It happens only on Windows or all OS?

Still I is not fixed.

ianhattendorf commented 7 years ago

Windows only AFAIK. Fix needs to happen in the spoon repo.

ahrherrera commented 7 years ago

@lexmihaylov Yes, I'm sorry not working on Windows. I had to install Ubuntu and set up my workspace there. It's working like a charm. I just has some problems with the plugin. I got an error on atom, seems like if rsense exec is looking on other folder. I installed ruby using RVM, the plugin is looking on the folder /home/{user}/.rvm/gems/ruby-2.4.0/ for rsense exec but there is no rsense exec. So I had to locate the rsense from the therminal with whereis rsense it will print the location of the executable. So I had to copy from the original location, to the requested location. Hope you can fix it.

chenasraf commented 7 years ago

@ahrherrera where was it actually placed? Does gem environment show that path at all? I'm considering just using which rsense as default value

ianhattendorf commented 7 years ago

@ahrherrera I've updated the error message and readme to be a little more clear. You just need to find where rsense is installed (which rsense) and update the Rsense Path plugin setting. You shouldn't copy it to another directory, as this is likely to break something.

@chenasraf Sounds like a good idea, just keep in mind windows doesn't have a which command. Then again, I think rsense is broken on windows so IDK. Also keep in mind that opening Atom through the shortcut doesn't pass the full path to the process, so it might not have rsense available in its path.

ianhattendorf commented 7 years ago

I'm going to go ahead and close this now, as I don't see RSense ever working on Windows again. If anyone finds a fix/replacement for RSense please comment here or open a new issue. Thanks!