You’re not receiving notifications from this thread.
Rails 7 and postgres 15
I've got Postgres15 installed via Homebrew, and it's running.
When I build a new Rails 7 app with: "rails new testapppg -d postgres" I can't get it to install pg (1.4.6)
I see errors like "Unable to find PostgreSQL client library.
I'm sure it's related to some type of path issue.
I can build a Rails 7 app with the default sqlite database and it works fine.
Thoughts on how to get Postgres15 configured so I can successfully get the pg gem installed?
Hey try installing the pg gem: gem install pg
I believe it is necessary for the connection. All the best
okay, before anyone attempts to answer this, I just found the tutorial here about installing ruby and rails... will follow it.
P.S. I've been coding rails forever and have apps running in 3.x for 10+ years. Now I'm setting up a new M2 machine to do Rails 7 work. Funny how this configuration stuff gets set up and forgotten rather quickly...
I continue to get errors with asdf loading ruby 3.3. Do I need to scrub off rvm completely? use an older version of ruby?
Ruby 3.2.2 is the latest Ruby version.
brew install libpq
does this solve your issue. not sure if it is still needed on the newer versions of macos
I appear to have libpq 15.2 installed. I'm wondering if I have issues with rvm being installed still on this machine.
Any one have comments as to whether killing rvm is a good thing? I've been developing in Rails since 2.3.8, and have rvm managing versions across multiple projects. Because of this issue, I'm now maintaining an older machine with the intact rvm install (and multiple projects, from Rails 3 to Rails 5).
I want to start of with some Rails 7 stuff, so I have a new M2 machine, just can't see to get postgres happy.
Okay, starting over.
I've ripped out rvm and old setups on this M2 Mac running 13.2.1
I've ripped out home-brew and reinstalled clean
ruby -v gives (which I believe is the default installed ruby):
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]
which ruby gives:
"asdf plugin add ruby" and "asdf plugin add nodejs" appear to work correctly
"asdf install ruby 3.2.2" gives this:
To follow progress, use 'tail -f /var/folders/l1/xdqq3b4s3w1gwvf2mtr861nh0000gn/T/ruby-build.20230417203505.37998.log' or pass --verbose
Installed openssl-3.1.0 to /Users/jiblethead/.asdf/installs/ruby/3.2.2
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
BUILD FAILED (macOS 13.2.1 using ruby-build 20230330)
Inspect or clean up the working tree at /var/folders/l1/xdqq3b4s3w1gwvf2mtr861nh0000gn/T/ruby-build.20230417203505.37998.ytrKZQ
Results logged to /var/folders/l1/xdqq3b4s3w1gwvf2mtr861nh0000gn/T/ruby-build.20230417203505.37998.log
Last 10 log lines:
linking shared-object socket.bundle
installing default openssl libraries
linking shared-object openssl.bundle
1 warning generated.
linking shared-object ripper.bundle
make: *** [build-ext] Error 2
thoughts? I'm getting tired of it, ready to get coding in Rails 7...
Here's the deal: If you build a M2 machine with a timemachine backup of a non-Apple Silicon machine, your homebrew will be installed in the wrong place. All subsequent actions get foiled along the way.
Start over by scrubbing the existing Homebrew, then installing it into "/opt/homebrew"
You can then install postgresql@15 with homebrew. Update your path with:
gem install pg -- --with-pg-config=/opt/homebrew/opt/postgresql@15/bin/pg_config
then the usual steps to create a new app, designating the database "-d postgresql"
running "rake db:create" and "rails server" gives you a clean Rails 184.108.40.206 app using Ruby 3.2.2 on an M2 Mac running Ventura 13.2.1
Hope this saves some time for someone...
I have issue with postgres 15 and fortunately I find this post. Thank you for your sharing.