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 #31

Closed spatindsaongo closed 7 years ago

spatindsaongo 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

Non-Core Packages

autocomplete-ruby 0.2.6 
ianhattendorf commented 7 years ago

Do you have ruby installed?

spatindsaongo commented 7 years ago

Yes, I have ruby installed.

ianhattendorf commented 7 years ago

What happens when you run which gem from the terminal? If you launch atom from the terminal by running atom, do you get the same error? Can you paste the results from gem environment?

spatindsaongo commented 7 years ago

Hi.

  1. When run which gem, i got this /home/username/.rbenv/shims/gem
  2. When i launch atom form the terminal, i still got the same error
  3. Result from gem environment :
    - RUBYGEMS VERSION: 2.5.1
    - RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-linux]
    - INSTALLATION DIRECTORY: /home/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0
    - USER INSTALLATION DIRECTORY: /home/username/.gem/ruby/2.3.0
    - RUBY EXECUTABLE: /home/username/.rbenv/versions/2.3.1/bin/ruby
    - EXECUTABLE DIRECTORY: /home/username/.rbenv/versions/2.3.1/bin
    - SPEC CACHE DIRECTORY: /home/username/.gem/specs
    - SYSTEM CONFIGURATION DIRECTORY: /home/username/.rbenv/versions/2.3.1/etc
    - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
    - GEM PATHS:
     - /home/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0
     - /home/username/.gem/ruby/2.3.0
    - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
    - REMOTE SOURCES:
     - https://rubygems.org/
    - SHELL PATH:
     - /home/username/.rbenv/versions/2.3.1/bin
     - /home/username/.rbenv/libexec
     - /home/username/.rbenv/plugins/ruby-build/bin
     - /home/username/.rbenv/plugins/ruby-build/bin
     - /home/username/.rbenv/shims
     - /home/username/.rbenv/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin
ianhattendorf commented 7 years ago

Odd, the error you're getting is because the plugin runs the command gem environment but can't find the gem executable in your path. I've seen issues with atom not loading the correct path when launched through the shortcut, but not when launched from the terminal.

When you launch it from the terminal, you're getting the same error regarding gem environment or do you get an error about rsense? If so, I'm not sure what the problem could be... Somehow atom isn't getting the correct path.

spatindsaongo commented 7 years ago

Hi. I think that error is about rsense. I launched atom from terminal and i got this message :

autocomplete-ruby: exec error: Error: Command failed: /home/username/.rbenv/versions/2.3.1/bin/rsense start --port 47367 --path /home/username/rubylearning
/bin/sh: 1: /home/username/.rbenv/versions/2.3.1/bin/rsense: not found
(You might need to set the rsense path, see the readme)
spatindsaongo commented 7 years ago

I found the cause of error. I didn't have rsense installed. I install it and when launch atom from the terminal there is no error. But i still have error with gem environment, when i launch atom from application menu.

ianhattendorf commented 7 years ago

Good to hear! Sounds like you have your path set/modified in ~/.bashrc, ~/.bash_profile, or ~/.bash_login. This works fine for your terminal, however apps launched from your desktop environment won't see these modifications. Try making all your path changes in ~/.profile or maybe ~/.pam_environment, and sourcing these files from one of the ~/.bash* files you were using before (if needed). Take a look here for more info on this: https://help.ubuntu.com/community/EnvironmentVariables#A.2BAH4-.2F.pam_environment

I'll go ahead and close this since it looks like you got it working. Feel free to comment again if you need more help getting the path working from your desktop environment.

cngondo commented 7 years ago

@ianhattendorf Thanks for the info.

I had the same error but when I'm opening from the terminal I still get the following error:

autocomplete-ruby: exec error: Error: Command failed: /home/ngondo/.rvm/gems/ruby-2.3.3/rsense start --port 47367 --path /home/ngondo/MORINGA/moringacore-android /bin/sh: 1: /home/ngondo/.rvm/gems/ruby-2.3.3/rsense: not found (You might need to set the rsense path, see the readme)

I have tried looking at the path issue to no avail. Kindly assist.

ianhattendorf commented 7 years ago

@cngondo Do you have rsense installed? If so, what's the output of which rsense? Take the output of that and put it in the rsense path setting for this plugin and try again.