mardi 18 février 2020

Vagrant Forwarded Port - Not connecting to app - VSCode Solargraph

I just moved to Mac from Ubuntu. I figured the best way to continue development would be using Vagrant and VirtualBox as the provider. I am having issues getting solargraph to work with VSCode from within vagrant.

The VSCode Solargraph plugin gives the error: Connection to the server is erroring. Shutting down server.

My config:

VSCode config

# .vscode/settings.json
{
  "solargraph.transport": "external",
  "solargraph.externalServer": {
    "host": "localhost",
    "port": 7658
  }
}

Vagrantfile

# Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-18.04"
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.network "forwarded_port", guest: 7657, host: 7658
end

When I do wget localhost:7657 from within the box I get the following response suggesting the sinatra server is up and running.

vagrant@vagrant:/vagrant$ wget localhost:7657
--2020-02-18 16:58:53--  http://localhost:7657/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:7657... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-02-18 16:58:53 ERROR 404: Not Found.

How ever when I do wget localhost:7658 I get the following...

wget localhost:7658
--2020-02-18 22:25:44--  http://localhost:7658/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:7658... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:7658... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.

Limitations:

  • A legacy app on Ruby 2.1
  • Installing 2.1 on MacOS through RVM or Rbenv ends with errors related to SSL and can't run it on the machine it self

Environment

  • rails 3.2.15
  • solargraph 0.10.3

Has any one encountered a similar issue and worked it out? Any advice appreciated. Thanks.

1 commentaire:

  1. In this manner my pal Wesley Virgin's report launches in this shocking and controversial VIDEO.

    Wesley was in the army-and soon after leaving-he discovered hidden, "MIND CONTROL" secrets that the government and others used to get anything they want.

    As it turns out, these are the same tactics many celebrities (notably those who "became famous out of nothing") and elite business people used to become wealthy and famous.

    You probably know how you use less than 10% of your brain.

    Mostly, that's because most of your BRAINPOWER is UNCONSCIOUS.

    Maybe that expression has even occurred IN YOUR very own head... as it did in my good friend Wesley Virgin's head around seven years back, while driving an unregistered, beat-up bucket of a car with a suspended driver's license and $3.20 on his banking card.

    "I'm absolutely fed up with living check to check! When will I finally make it?"

    You took part in those types of conversations, isn't it right?

    Your success story is going to happen. All you have to do is in YOURSELF.

    UNLOCK YOUR SECRET BRAINPOWER

    RépondreSupprimer