-
pg gem pg-0.18.4 install errors: implicit declaration of function ‘gettimeofday’ is invalid in C99
Reflexively trying the usual suspects installing pg-0.18.4: https://stackoverflow.com/questions/63182467/not-able-to-install-pg-gem-with-rails Maybe xcode is improperly installed? sudo xcode-select -s /Library/Developer/CommandLineTools Maybe postgresql is improperly installed? brew install postgresqlRunning `brew update –preinstall`… Warning: postgresql 14.2_1 is already installed and up-to-date.To reinstall 14.2_1, run:brew reinstall postgresql ❯ brew reinstall postgresql gem install pg -v ‘0.18.4’ It would have been beneficial…
-
An error occurred while installing debase 0.2.4.1 and…
An error occurred while installing debase (0.2.4.1), and Bundler cannot continue. https://github.com/ruby-debug/debase/issues/65 gem install debase — –with-cflags=”-Wno-error=implicit-function-declaration”
-
Getting a Count of Occurrences of Items in a Ruby Array (and a Caveat for Rails)
I feel like I’m often wanting to count occurrences of items in an array (Rails has its own special case as well), and I’m always trying to do it the “long way.” I finally stumbled upon this answer on StackOverflow that details the version-by-version options: Ruby 2.7+ use .tally directly on the array: Ruby 2.4+…