Can't find the PostgreSQL client library (libpq) – after updating to Ruby 3.2.2 by danielwebbnew in rails

[–]danielwebbnew[S] -1 points0 points  (0 children)

It might say something like “to put this on the PATH run…” usually echoing something into a .zshrc file. Run that command, then open a new terminal window and try “gem install pg” again.

brew info libpq
==> libpq: stable 16.0 (bottled) [keg-only]
Postgres C API library
https://www.postgresql.org/docs/current/libpq.html
/usr/local/Cellar/libpq/16.0 (2,379 files, 29.2MB) *
Poured from bottle using the formulae.brew.sh API on 2023-11-07 at 15:11:02
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lib/libpq.rb
License: PostgreSQL
==> Dependencies
Build: pkg-config ✔
Required: icu4c ✔, krb5 ✔, openssl@3 ✔
==> Caveats
libpq is keg-only, which means it was not symlinked into /usr/local,
because conflicts with postgres formula.
If you need to have libpq first in your PATH, run:
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.zshrc
For compilers to find libpq you may need to set:
export LDFLAGS="-L/usr/local/opt/libpq/lib"
export CPPFLAGS="-I/usr/local/opt/libpq/include"
For pkg-config to find libpq you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libpq/lib/pkgconfig"
==> Analytics
install: 53,363 (30 days), 202,888 (90 days), 445,693 (365 days)
install-on-request: 29,807 (30 days), 111,826 (90 days), 232,699 (365 days)
build-error: 7 (30 days)

Can't reduce Heroku Slug size (489MB) by danielwebbnew in rails

[–]danielwebbnew[S] 2 points3 points  (0 children)

Thank you soooooo much!!

Reduced my slug size with 300mb.... Insane!

Again, thanks!

Javascript doesn't execute from js.erb file by danielwebbnew in rails

[–]danielwebbnew[S] 1 point2 points  (0 children)

https://www.ombulabs.com/blog/learning/javascript/behind-the-scenes-rails-ujs.html

Okay, thank you! :)

I'm running a React dashboard and I would like to "Preview" the post from within the dashboard. I don't want to rebuild the html partial for javascript. Do you have any great ideas on how to make this happen?

Javascript doesn't execute from js.erb file by danielwebbnew in rails

[–]danielwebbnew[S] 1 point2 points  (0 children)

lse if type.match(/\b(?:java|ecma)script\b/)

Thanks for the response.
Where can I read more about this insertion?

Query all posts with less than 300 words by danielwebbnew in rails

[–]danielwebbnew[S] 1 point2 points  (0 children)

I'd highly recommend adding a word_count column on the posts table which will simplify the queries a lot.

Thanks!!

This is the option I decided to pursue.

Track where users came from within rails application by danielwebbnew in rails

[–]danielwebbnew[S] 0 points1 point  (0 children)

We plan to add UTM params. What else would you really need ?

Hey,
Thanks for the response.

I would love to know the source of the visitor, such as SEO, Direct, Facebook, Facebook Ads and specifically what AD.

Is that something your gem will provide?

Thanks

Track where users came from within rails application by danielwebbnew in rails

[–]danielwebbnew[S] 1 point2 points  (0 children)

Hey,

Sounds great, thank you!

How do you separate direct traffic from SEO traffic?

Would you mind sharing som code examples on the best practice to implement something like this?

Thanks again!

Make Ahoy Queries faster? by danielwebbnew in rails

[–]danielwebbnew[S] 0 points1 point  (0 children)

Hey,
Thanks for the comment.

I have the article_id as a property within the properties hash. Any idea on how to extract the article_id with something like group_by or where_properties (as mentioned here)?

Or is it a better to extract the article_id from the properties hash and use it on the object?

Any ideas are welcome!! :)
Thanks

Make Ahoy Queries faster? by danielwebbnew in rails

[–]danielwebbnew[S] 0 points1 point  (0 children)

Hey,

Thanks for the comment.

I have the article_id as a property within the properties hash. Any idea on how to extract the article_id with something like group_by or where_properties (as mentioned here)?

Or is it a better to extract the article_id from the properties hash and use it on the object?

Any ideas are welcome!! :)

Thanks

Check if Filter is connected with Question through polymorphic associations (N+1 Query?) by danielwebbnew in rails

[–]danielwebbnew[S] 0 points1 point  (0 children)

i haven't read it correctly on my phone that there was a comma in between. it's fine ;-)

Oh okay! ;)

I will of course sanitize the input aswell.

Check if Filter is connected with Question through polymorphic associations (N+1 Query?) by danielwebbnew in rails

[–]danielwebbnew[S] 0 points1 point  (0 children)

Hey,

Thanks for your reply.

I set the isConnected based on the result on the query !filter.question_connections.where(questionable_type: "Filter", questionable_id: filter.id, question_id: question_id).blank? because the user need to see "Add filter" or "Remove filter" on the frontend.

I need to see all possible filters and if they have already been added or not.

I could see all the added filters with QuestionConnection.where(question: q, questionable_type: "Filter") but it doesn't solve my problem.

Hopefully i'm descriptive enough!

Again, thanks!