Giter Site home page Giter Site logo

Comments (12)

rpf13 avatar rpf13 commented on August 16, 2024

I have the exact same issue, can't bring solargaph to work with atom. VSCode works fine...

from atom-solargraph.

svoop avatar svoop commented on August 16, 2024

The current versions (ruby-solargraph 0.6.1 and solargraph 0.37.2) work just fine on my Mac with Ruby 2.6.5 installed from source with ruby-install and managed by chruby.

You might want to check the settings of the ruby-solargraph package in Atom and make sure, the path to the solargraph binary is correct.

I use the following to update this setting on the CLI after every Ruby upgrade:

sed -i "" "s|commandPath: \".*/solargraph\"|commandPath: \"${HOME}/.gem/ruby/$(ruby -e 'puts RUBY_VERSION')/bin/solargraph\"|" ~/.atom/config.cson

As an alternative, just edit this setting in Atom yourself. To figure out the solargraph binary path to use:

echo "${HOME}/.gem/ruby/$(ruby -e 'puts RUBY_VERSION')/bin/solargraph"

⚠️ Bear in mind that the use of RVM will complicate things and the above most likely won't work. I've dumped RVM a long while ago in favor of chruby which doesn't isolate gemsets – we have Bundler for that now.

from atom-solargraph.

dedman avatar dedman commented on August 16, 2024

I just installed on Mac too, and have checked all the obvious things and still doesn't seem to work. Did you guys get it working eventually?

from atom-solargraph.

msharma-boop avatar msharma-boop commented on August 16, 2024

Same issue for me. I've followed all the above steps and still couldn't able to figure out the solution

from atom-solargraph.

crush-157 avatar crush-157 commented on August 16, 2024

Revisiting this.

Today I tried again.

Note I use ruby-install and chruby not RVM as per @svoop's comments above.

MacOS Mojave 10.14.6
Ruby 2.7.1
Atom 1.50.0

I installed solargraph gem
Checked it runs as a shell command
Used which solargraph to get the path
Opened Atom
Installed ruby-solargraph package 0.6.1
Updated command path to point to the solargraph command
Restarted atom
Opened a ruby source file

And nothing happens. I type variable-name.<space / tab / first-letter-of-method> => nothing.

@svoop - what combination of keystrokes (on a Mac) do you use to trigger autocomplete?

Can you see anything missing from the steps above?

from atom-solargraph.

crush-157 avatar crush-157 commented on August 16, 2024

@castwide any comment?

from atom-solargraph.

castwide avatar castwide commented on August 16, 2024

@crush-157 The extension is only confirmed to work with rvm and rbenv, so chruby might pose a problem. I'll test on a MacBook and see what I can figure out. If anyone has had success with MacOS and chruby, please let us know.

from atom-solargraph.

svoop avatar svoop commented on August 16, 2024

@castwide @crush-157 I got it to work on a Mac with chruby as follows:

Install the atom-solagraph package, then create a wrapper for the binary as /opt/bin/solargraph:

#!/bin/bash
$(gem env gemdir)/bin/solargraph "$@"

Make sure the wrapper is executable:

chmod a+x /opt/bin/solargraph

Then edit the path to the binary in ~/.atom/config.cson to read:

"ruby-solargraph":
  commandPath: "/opt/bin/solargraph"

Finally, make sure the solargraph gem is installed on all Ruby versions you're using with chruby.

Don't forget to restart Atom to make sure it picks up the changes. At least my Atom didn't without a restart.

from atom-solargraph.

msharma-boop avatar msharma-boop commented on August 16, 2024

@castwide I tried setting up solargraph as per instruction on Mac and

ruby **ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
**
solargraph : 0.39.15
and reset the command path too. Stil not working for me
please assist

from atom-solargraph.

crush-157 avatar crush-157 commented on August 16, 2024

@svoop I have tried doing as you said and it made no difference.

Question: what keystrokes are you using, if any, on a mac, to start code completion?

from atom-solargraph.

svoop avatar svoop commented on August 16, 2024

@crush-157 I'm kinda peculiar with keystrokes and configured all kind of search and autocomplete stuff on combinations of ctrl, alt, cmd and space. For solargraph, I've assigned cmd-space which usually opens Spotlight. (I don't use Spotlight very often and therefore disabled cmd-space systemwide in sysprefs, so no collision there.)

from atom-solargraph.

crush-157 avatar crush-157 commented on August 16, 2024

@svoop sadly I use spotlight all the time!

Another thing I'm curious about is why the wrapper? I followed your directions in a cargo - cult fashion just to see if it helped but it didn't.

I wasn't that surprised, since solargraph was running just fine from the command prompt as soon as I installed the gem.

from atom-solargraph.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.