alexreisner / geocoder

Complete Ruby geocoding solution.
http://www.rubygeocoder.com
MIT License
6.35k stars 1.19k forks source link

Update pg gem version in the Gemfile #1649

Open takatea opened 9 months ago

takatea commented 9 months ago

This PR updates the pg gem version in the Gemfile for developing this project.

Details

While setting up my local environment for this project, I encountered an error during bundle install related to the installation of the pg gem:

pg_binary_decoder.c:115:20: error: call to undeclared function 'rb_tainted_str_new'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

This error was resolved by updating the pg gem to the latest version (1.5.x) from the old version (0.11.x). This allowed me to successfully run bundle install. Additionally, I could run bundle exec rake and see all the tests pass.

How about this change?

Environment

I have tested this change with the following environment:

gcc

gcc -v
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin22.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

postgresql

psql --version psql
psql (PostgreSQL) 14.11 (Homebrew)

Ruby

ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22]
alexreisner commented 9 months ago

Thanks for this. And yes, I think it's safe to bump the pg version number. However, Geocoder currently supports Ruby >=2.1, and pg 1.5 requires Ruby 2.5+, so that's a problem. The latest version of pg that supports Ruby 2.1 is 1.1.4. Does pg v1.1.4 install correctly on your system? If so, let's bump it to that instead.

takatea commented 9 months ago

@alexreisner Thank you for your comment! I got the same error described the description when I tried to change the pg version to 1.1.4 and then ran bundle install...

alexreisner commented 9 months ago

Can you try troubleshooting your install of the pg gem, maybe by using the option discussed here? We can't bump the pg version past 1.1.4.

takatea commented 8 months ago

@alexreisner

Thanks! I got that Ruby 2.1 need to be supported! So, I am trying to change pg gem version to => 0.11 in Gemfile and trying to test with Ruby 2.1.