Spring isn't reloading when database is changed from SQLite to Postgress
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start with the reported databases.yml change and reproduce it through rails console, comparing behavior before and after running spring stop. Check how Spring handles configuration changes while rails db:migrate and db:create still work. Done means changing from SQLite to PostgreSQL no longer leaves the console using the old connection, or the required reset behavior is clearly documented.
Written by the indexing model from the issue text.
Description
So I'm working on my first rails 5 application. I got rails 5 installed, and then ran rails server to make sure everything was working correctly.
Then I started working on creating record. I changed databases.yml to point to postgress, created and ran migrations. Then jumped into rails console to create some records. Then I get the error that it can't find the tables.
I kinda bashed my head on this for a while. Until I tried Record.connection in the rails console to find out that it's trying to load these tables using SQLite.
Then I figured out what spring is, and how to reset it. I ran "spring stop" and tried creating the records again and it was now finally talking to postgress. So I'm guessing spring didn't notice the database change, and just kept on running thinking that SQLite was fine and dandy. Oddly enough rails db:migrate and db:create all worked fine.
Many novices might run into the same issue. And not knowing what spring is might make it a lot more difficult to get into rails. :/
- Dominant language
- Ruby
- Stars
- 2.8k
- Forks
- 342
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rails/spring
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 32/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Similar issues
-
バグ
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
voxpupuli/puppet-epel#186 · 1 comment ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) OpenBug Frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TheOdinProject/curriculum#31402 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100