Code Monkey home page Code Monkey logo

Comments (3)

jasonperrone avatar jasonperrone commented on June 9, 2024 2

@mildred Can I ask a question? Do you think this would cause this problem I am facing since upgrading Spring from 2.1.1. I have the following command:

bin/rails db:drop RAILS_ENV=test DATABASE_URL=test_lib

Since upgrading Spring, the DATABASE_URL env variable is being ignored. Just wondering if I need to report a new issue or is this the same issue.

from spring.

pboling avatar pboling commented on June 9, 2024

I'm having a similar issue with MYSQL_SOCKET being ignored, even though I can see it is set after Spring forks.

Running via Spring preloader in process 41869
ENV['MYSQL_SOCKET']: "/tmp/mysql.sock"

An error occurred while loading ./spec/jobs/my_job_spec.rb.
Failure/Error: ActiveRecord::Migration.maintain_test_schema!

ActiveRecord::ConnectionNotEstablished:
  Can't connect to local MySQL server through socket '' (2)
# ./spec/support/config/migrations.rb:3:in `<top (required)>'
# ./spec/rails_helper.rb:18:in `<top (required)>'
# ./spec/jobs/my_job_spec.rb:1:in `<top (required)>'
# -e:1:in `<main>'
# ------------------
# --- Caused by: ---
# Mysql2::Error::ConnectionError:
#   Can't connect to local MySQL server through socket '' (2)

where the file spec/support/config/migrations.rb looks like:

puts "ENV['MYSQL_SOCKET']: #{ENV['MYSQL_SOCKET'].inspect}"
# Ensure that all migrations have been run before running specs
ActiveRecord::Migration.maintain_test_schema!

I'm not sure how this is possible. The ENV variables are set and managed by direnv in an .envrc file.
I'm on Rails 7.0.7.2 and spring 4.1.1

from spring.

pboling avatar pboling commented on June 9, 2024

For me it was a case of two different spring processes running. One in the foreground in my terminal, which worked, and responded to commands also sent from the terminal, and the other was running hidden in RubyMine, and it had not been restarted when I was manually restarting the one in my Terminal.
See: https://www.jetbrains.com/help/ruby/spring.html#stop_spring

from spring.

Related Issues (20)

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.