ianhattendorf / autocomplete-ruby

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

Failed to activate the autocomplete-ruby package #36

Closed Freivincampbell closed 7 years ago

Freivincampbell commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.15.0 x64 Electron: 1.3.13 OS: Ubuntu 16.04.2 Thrown From: autocomplete-ruby package 0.2.6

Stack Trace

Failed to activate the autocomplete-ruby package

At Command failed: gem environment
/bin/sh: 1: gem: not found

Error: Command failed: gem environment
/bin/sh: 1: gem: not found

    at checkExecSyncError (child_process.js:495:13)
    at execSync (child_process.js:535:13)
    at childProcess.(anonymous function) (ELECTRON_ASAR.js:680:22)
    at getExecPathFromGemEnv (/packages/autocomplete-ruby/lib/gem-home.coffee:6:12)
    at /packages/autocomplete-ruby/lib/gem-home.coffee:15:1)
    at /packages/autocomplete-ruby/lib/gem-home.coffee:1:1)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (/app.asar/src/native-compile-cache.js:50:27)
    at /packages/autocomplete-ruby/lib/autocomplete-ruby.coffee:2:12)
    at /packages/autocomplete-ruby/lib/autocomplete-ruby.coffee:1:1)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (/app.asar/src/native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (/app.asar/src/package.js:796:27)
    at Package.module.exports.Package.activateNow (/app.asar/src/package.js:207:16)
    at /app.asar/src/package.js:190:32
    at Package.module.exports.Package.measure (/app.asar/src/package.js:96:15)
    at /app.asar/src/package.js:183:26
    at Package.module.exports.Package.activate (/app.asar/src/package.js:180:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/app.asar/src/package-manager.js:550:34)
    at /app.asar/src/package-manager.js:531:29

Commands

     -1:22.5.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always.panel-shadows.use-animations.compact-tree-view.theme-ramda-syntax.theme-atom-material-ui)

Non-Core Packages

atom-material-ui 1.3.9 
auto-indent 0.5.0 
autocomplete-ruby 0.2.6 
busy-signal 1.3.0 
chester-atom-syntax 0.1.1 
execute-as-ruby 0.2.1 
file-icons 2.1.3 
gloom 0.4.13 
highlight-selected 0.13.1 
intentions 1.1.2 
linter 2.1.3 
linter-rubocop 2.0.0 
linter-ruby 1.2.5 
linter-ui-default 1.2.3 
minimap 4.27.1 
minimap-highlight-selected 4.6.1 
nord-atom-ui 0.11.0 
ramda-syntax 1.0.3 
ruby-block 0.3.6 
Freivincampbell commented 7 years ago

Hello, for my error solve it in a somewhat convensional way, the error occurs in line 6 of the file: "/home/your_username/.atom/packages/autocomplete-ruby/lib/gem-home.coffee". I went to my terminal and run the command that gives error and is: "gem environment" find the line that is needed and paste it, I hope it works for something while they deliver error. regards

Example:

image

Before

image

After

image

Result

image

ianhattendorf commented 7 years ago

I've just updated the readme with a "Known Issues" section. Have you tried launching atom from the terminal? Most likely you have a custom path/environment setting in your bash/zsh config that isn't being picked up when launching atom from its launcher.

ianhattendorf commented 7 years ago

I assume you were able to get this working due to the thumbs up, closing.

Evil-crow commented 6 years ago
Error starting rsense
autocomplete-ruby: exec error: Error: Command failed: /home/Crow/.rvm/gems/ruby-2.4.2/bin/rsense start --port 47367 --path .
/usr/bin/env: ‘ruby_executable_hooks’: No such file or directory
(You might need to set the rsense path, see the readme

I had done what you had told me.But I can't use autocomplete-ruby normally Could you help me? Thank you very much!

ianhattendorf commented 6 years ago

The error you're getting (‘ruby_executable_hooks’: No such file or directory) looks to be an issue with your installation, possibly RVM.

I would recommend searching for the error on Google and seeing if you find anything that solves your problem. For example: https://stackoverflow.com/questions/26247926/how-to-solve-usr-bin-env-ruby-executable-hooks-no-such-file-or-directory

Evil-crow commented 6 years ago

I'm sorry to reply to your mail so late,it isn't an easy thing to use gmail in China. The reason ,emmmmm, I think you know it.

That problem I haven't solved,I'll try what you have recommended.

Now I use the Plug named "Ruby Solargraph" on vscode for Ruby-auto-completation

And I'm sorry that my English is so bad.

Well,I still have to thank you very much.

(Some of the contents are Machine Translation,I'm sorry)

谢谢你

2018-01-19 0:52 GMT+08:00 Ian Hattendorf notifications@github.com:

The error you're getting (‘ruby_executable_hooks’: No such file or directory) looks to be an issue with your installation, possibly RVM.

I would recommend searching for the error on Google and seeing if you find anything that solves your problem. For example: https://stackoverflow.com/ questions/26247926/how-to-solve-usr-bin-env-ruby- executable-hooks-no-such-file-or-directory

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ianhattendorf/autocomplete-ruby/issues/36#issuecomment-358708736, or mute the thread https://github.com/notifications/unsubscribe-auth/AbgZfdvY8zn8YBAhPEAcdyZqyY8y9GFrks5tL3bFgaJpZM4M9-TM .

adiwids commented 5 years ago

I'm using this package on atom 1.38.beta-0 on Ubuntu 64bit + RVM To makeit work on my machine, I changed this line on $HOME/.atom/packages/autocomplete-ruby/lib/gem-home.coffee

stdout = execSync 'gem environment'

to

stdout = execSync "$SHELL -l -c 'gem environment'" 

and change this too on $HOME/.atom/packages/autocomplete-ruby/lib/autocomplete-ruby-client.coffee

exec("#{@rsensePath} start --port #{@port} --path #{@projectPath}",

to

exec("$SHELL -l -c '#{@rsensePath} start --port #{@port} --path #{@projectPath}'",

and also the stopRsense: => block.