Chris Oliver

Joined

291,200 Experience
86 Lessons Completed
299 Questions Solved

Activity

Posted in JWT with Devise (App and API)

Oliver, yep. If you login on the web, you'll login with a session cookie. Otherwise you'll hit the API with a token and be logged in only for that request.

Posted in Unable to create the Rails app in WSL

Sounds like permissions issues and seems like other people have experienced that. Try this: https://askubuntu.com/a/1118158

Posted in Webpack assets doesn't work after deployment

Hmm, good to know. I'm not quite sure why that would be required, but at least you got your problem solved.

I haven't had to do that, but maybe there's something with the way your code is requiring things that makes it need that.

Posted in Webpack assets doesn't work after deployment

Nope, should be nothing to do with Capistrano.

Try running "RAILS_ENV=production bundle exec rake assets:precompile" on the server and confirm it compiles your webpacker assets.

The webpacker:compile step gets appeneded to the precompile, so you never need to run the webpacker command directly.

Posted in Webpack assets doesn't work after deployment

Okay, looks good. I can see the error now.

On your server, is there the matching filename from the error inside public/packs/ ? Seems like the file compiled successfully, so I would check and make sure the file exists on disk. Then you can tell if it's a configuration issue or something else.

Posted in Webpack assets doesn't work after deployment

The JS error link is broken there.

 DEBUG [1885af3e]   yarn install v1.12.3
 DEBUG [1885af3e]   warning package.json: No license field
 DEBUG [1885af3e]   warning No license field
 DEBUG [1885af3e]   [1/4] Resolving packages...
 DEBUG [1885af3e]   [2/4] Fetching packages...
 DEBUG [1885af3e]   info fsevents@1.2.7: The platform "linux" is incompatible with this module.
 DEBUG [1885af3e]   info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
 DEBUG [1885af3e]   [3/4] Linking dependencies...
 DEBUG [1885af3e]   warning "@rails/webpacker > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".
 DEBUG [1885af3e]   warning " > webpack-dev-server@2.11.2" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
 DEBUG [1885af3e]   warning "webpack-dev-server > webpack-dev-middleware@1.12.2" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
 DEBUG [1885af3e]   [4/4] Building fresh packages...
 DEBUG [1885af3e]   Done in 24.61s.

This shows that it's running and compiling your webpack code successfully.

How are you including your packs in your layout?

Posted in Webpack assets doesn't work after deployment

You don't need to link app/javascript/packs. During precompile, it will run yarn and output the files in public.

If you're not seeing the files, then it's an issue with your precompile step. Do your capistrano logs show that it's running the precomile and does that step say anything about webpacker?

Posted in Webpack assets doesn't work after deployment

Like Ivan said, more information is important.

For me, I just make sure Yarn is on my server and it automatically compiles during the assets:precompile step. Simple as that.

That looks feasible to me. The one I've run into trouble with in the past is Faraday since many gems depend upon it. You might need to update some other gems to allow your Faraday dependency to update high enough. Might neet do the same for a couple other gems.

Posted in How to test attachments in ActionMailbox?

Thanks for posting the solution! I'm going to be covering this soon so I might use your example here. 🙌

This would be great. I'll try and do an episode on Uppy soon.

Posted in How do I remove Devise::Trackable from my app?

Yep, that should be it. You don't have to remove the columns, but you might as well if you don't need the data.

Thanks Monroe! It's been a heck of a lot of work, but these are the reasons that keep me going. 🙏

The Rails community is a special place. So many helpful people here, so I am thankful for all of you in the community who make this possible!

You'd just need to find a video player that will do it for you (that way you don't have to build it yourself).

https://www.jwplayer.com/video-ad-support/
https://cloudinary.com/product_updates/video_player_ads

There are several other options.

If you wanted to build it yourself, you'd first play the ad, then when it is finished, replace the video with your content. All that will probably be in Javascript and you'd need videos for the ads and such to serve up. And you'd want to collect ad metrics for plays and clicks, etc probably.

Hey Edmundo,

Oh yeah, great point. I believe you just set data-controller="tabs" data-tabs-index="1" to have it select the 2nd tab, but that would have to be rendered in the HTML.

We may want to add some other method of doing this too. Possibly looking at the anchor in the url and selecting the target with the matching ID.

Posted in How to use Action Mailbox in Rails 6 Discussion

Same way params is available to all methods in your controller. It's simply a method defined in the parent class.

That initializer works too. I'm just putting everything in the same class for now to keep it organized.

The stylesheet pack tag is used for serving stylesheets in production, or in development if you have it configured that way.

Posted in Should I rewrite my app?

Basecamp rewrites their app every 4 or so years and continues to maintain the old versions for any users who don't wish to upgrade. They explain it similar to buying a car. Porsche's going to completely redesign the 911 every 5 years or so, but that doesn't mean all existing 911 users are forced to upgrade. They can if they'd like to, but there's no requirement to and you only have to fix bugs (which should get less and less over time) on the old product.

I always thought that was an interesting philosophy for software which almost never is seen this way. You're always forced to upgrade to the rewrite. Something to keep in mind!

And if you rewrite, I'd consider using the existing database and then adding any migrations you need to change it to how you'd like it to be. That way you can more easily transition customers over to the new version.

Great points! 👍

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.