Unable to connect in local environment

Asked 2 years ago, Updated 2 years ago, 81 views

I am a beginner studying with Ruby on Rails 5 Quick Learning Practice Guide.
In Chapter 5, "Let's get started" by rspec on page 205, the test failed and I'm struggling to move on.
There is no problem looking back at the series of codes themselves over and over again.
Local connection seems to be denied.
ubuntu wsl ruby 2.5.1 rails 5.2.1 ? 5.2.2 maybe.
Is there no chromedriver?Chromedriver-helper is installed.

Capybara starting Puma...
* Version 3.12.0, codename: Llamas in Pajamas
* Min threads : 0, max threads : 4
* Listening on tcp://127.0.0.1:55084
F

Failures:

  1) Task Management Feature Listing Function When User A is logged in, the task created by User A is displayed.
     Got0 failures and 2 other errors:

     1.1) Failure/Error: visit login_path

          Errno::ECONNREFUSED:
            Failed to open TCP connection to 127.0.0.1:9515 (Connection refused-connect(2) for "127.0.0.1" port 9515)



          # ./spec/system/tasks_spec.rb: 15: in `block(4 levels) in <top(required)>'
          # ------------------
          # --- Caused by :-
          # Errno::ECONNREFUSED:
          #   Connection refused-connect(2) for "127.0.0.1" port 9515
          #   ./spec/system/tasks_spec.rb: 15: in `block(4 levels) in <top(required)>'

     1.2) Failure/Error:
            raise e, "Failed to open TCP connection to" +
              "#{conn_address}:#{conn_port} (#{e.message})"

          Errno::ECONNREFUSED:
            Failed to open TCP connection to 127.0.0.1:9515 (Connection refused-connect(2) for "127.0.0.1" port 9515)

ruby-on-rails rspec

2022-09-30 11:19

1 Answers

Failed to open TCP connection to 127.0.0.1:9515 (Connection refused-connect(2) for "127.0.0.1" port 9515)

[Direct translation] Attempt to open connection to port 9515 on the same machine (ip address: 127.0.0.1) failed

The message indicates that the process that should be listening on the 9515 port is either not started or failed to start.

Try restarting the machine and starting Ruby on Rails again.
Also, check to see if you receive a message indicating that the process failed to start.

Port 9515 is used by the Chrome Driver, so make sure that the chromedriver is started.


2022-09-30 11:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.