Chris Oliver

Joined

295,510 Experience
98 Lessons Completed
295 Questions Solved

Activity

Posted in Passenger vs Puma

It's about 100x easier for anyone new to running their own Rails apps. It's far more helpful when things go wrong with it's nice error pages and everything. That's the main reason.

Learning should start with the easy way to get started and then work your way up. Most of the support requests I get on Hatchbox come from people using Puma with know knowledge of how to use or debug it. That doesn't happen with Passenger since it just works and doesn't require any special setup. Puma requires you to run it as a separate service, unix sockets, gotta read the logs to find out why it's not running, etc. Not near as user friendly, but that's why they can charge money for Passenger.

It's also faster than Puma if you pay for Passenger Enterprise, but it can be costly. Since it's written as an NGINX module, it's running C code, not Ruby. https://www.rubyraptor.org/how-we-made-raptor-up-to-4x-faster-than-unicorn-and-up-to-2x-faster-than-puma-torquebox/ "Raptor" was their codename for Passenger 5.

Puma is free, so most people like that for obvious reasons. There are lots of blog posts on both, so you can make the decision on what you want to use.

Posted in Liking Posts Discussion

The base project is generally using https://github.com/excid3/jumpstart

Posted in Why Wistia?

Sadly pretty much all video is gonna be fairly expensive. You can look at Vimeo or just rolling your own with AWS S3 and using access permissions / presigned url. You'll have to have your own player for S3, like video.js or something. There are a few other options out there like bitmovin, but it's gonna depend a bit on how much you want to pay vs roll your own.

Posted in Payments with Stripe Master Class

Hey Brian!

I would just use Rails.env in your line there to make it dynamic. Should be something like this:

<%= tag :meta, name: "stripe_key", content: Rails.application.credentials[Rails.env][:stripe_publishable_key] %>

Posted in Setup Windows 10 Discussion

Hey John, not sure why that command doesn't work from you. I just pasted in the RVM installation instructions from their website. I don't use RVM though but as long as you get the gpg keys imported, that's all you need.

Hey Andrei,

Currently, it's just me and that's something you'll need to consider. Hopefully it'll make enough money to afford a team in the long run. If you decide to cancel your subscription, you won't be able to deploy anymore but your app will continue running.

Posted in How to change Boolean Value on specific date.

Hey Jeff,

Have you seen this episode? https://gorails.com/episodes/scheduling-posts It does this without extra complication.

Otherwise you could use a background job or cron job to toggle it, but that's probalby overkill unless you can't use the above option for some reason.

Posted in Setup Windows 10 Discussion

Alberto, yep. You'll always need libpq-dev to compile the C extension for Ruby to talk to Postgres. 👍

Make sure your User validations are passing. We only validate the email and password in this example so if you've required other fields, your User won't be saved.

Posted in Doorkeeper Omniauth OAuth Client Discussion

Hey Trevor,

That means your raw_info is returning nil. It should be returning an hash {}.

Also I uploaded all the source code for these finally so you can reference my omniauth gem. I think I made some tweaks to it. https://github.com/gorails-screencasts/oauth-api-authentication

I'm not sure it's so worriesome. A markdown editor is super simple so unless there are a ton of bugs, there's not much maintenance that you would need.

That's actually leftover from when I moved away from SimpleMDE. I forgot to remove that. Unfortunately Trix isn't great for code samples so I think I'm going to be migrating back.

Luckily HTML is valid Markdown, but like you see above, you can't really have Markdown in HTML because the characters will be escaped.
You could send them the message with ActionCable right after your PDF code finishes generating the file. You'd have to store the file somewhere and then include the link to it. Probably S3 for storage. 

The problem with deleting the file after the user downloads it is that you then break the link. If they click the link again they'll get a 404 and you'll certainly end up with support calls dealing with that.

With email, you could generate the PDF and just email it over as an attachment. That way you wouldn't have to store a copy of the file and the user can always reference the file as long as they don't delete the email. This would probably be easiest to manage overall if you don't want to store the PDFs permanently on S3.
They're all encrypted. Not sure why you would store anything in plaintext like that.

Posted in How do I sort values incoming from an API call?

Hey Chantal,

You would just use regular Ruby sort_by or sort_by! to sort the array that you get back from the API. https://apidock.com/ruby/Enumerable/sort_by
Awesome, Abraham! Thanks for sharing!

Posted in Rails Application Templates Discussion

You're all good, easy to overlook those things sometimes! :D

Posted in Rails Application Templates Discussion

Like the error mentions:
07:55:57 sidekiq.1 | Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)

Make sure you have Redis installed and running. Anytime you have a connection refused for any service like Postgres, MySQL, Redis, etc, it means it's not running. 

Posted in Doorkeeper Omniauth OAuth Client Discussion

Thanks for the heads up! What a pain in the butt.
Since the models are shared with ALL uploads, if you extend say ActiveStorage::Attachment, all attachments will have that functionality even though they might not need it.

ActiveStorage is quite a different approach than the other file uploading tools like Shrine. Plus it's fairly early right now and some of the functionality only works well with images (namely the variants stuff) which gets annoying if you want to do things like extend AS to make for transcoding video easier or whatever.