Skip to content

Instantly share code, notes, and snippets.

View esteedqueen's full-sized avatar
😼

Esther Olatunde esteedqueen

😼
View GitHub Profile
@esteedqueen
esteedqueen / rails_g_migration.md
Last active September 7, 2023 04:36
The curious case of frozen/hanging terminal when you run a`rails g migration` command

Ref: https://stackoverflow.com/questions/24622568/rails-generate-model-hangs

So, I ran into a mysterious situation where running a rails g migration ... command on my terminal freezes/hangs for a really long time.

Running ps aux | grep spring gave me a clue into what was going on.

I got the following:

esther 4201 0.0 0.0 2480224 2692 ?? S 6Sep17 0:00.82 spring server | panacea | started 191 hours ago
@esteedqueen
esteedqueen / dumping_pg_data.md
Last active August 31, 2018 18:48
TIL - dumping production PG database into development PG database

Step 1 - Create a Backup and Download it

heroku pg:backups:capture
heroku pg:backups:download

Step 2 - Using pg_restore command

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U username -d development_dbname ~/Downloads/blah1234blah789

@esteedqueen
esteedqueen / fix_rbenv.md
Last active June 3, 2024 08:02
How to fix rbenv: version `x.x.x` is not installed

So, you just cloned an existing project's repo and you run bundle install but you got the error: rbenv: version x.x.x is not installed....

What the issue means? The project uses a specific ruby version that you do not have on your system.

Here's how to fix it:

  • Install the Ruby build for the specified version using:
rbenv install x.x.x
@esteedqueen
esteedqueen / rails_console_docker.md
Last active July 5, 2018 13:54
Access Rails console in a docker container

To access the rails console in a docker container, run:

docker-compose run web rails console
@esteedqueen
esteedqueen / address_in_use_error.md
Created July 31, 2018 00:53
How to handle address already in use error

You attempted to start up a server, only to be confronted with the following error:

Address already in use - bind(2) for "0.0.0.0" port 3000 (Errno::EADDRINUSE)

What do you do?

  1. Figure out what service is using that address port.