Jerome .

Joined

340 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in Deploy Ubuntu 22.04 Jammy Jellyfish Discussion

other deprecation.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

Posted in Deploy Ubuntu 22.04 Jammy Jellyfish Discussion

example of 'Daemons using outdated libraries': systemd-logind.service

Posted in Deploy Ubuntu 22.04 Jammy Jellyfish Discussion

I have created 4 droplets. 4 times the same behaviours popped up.
There are deprecated methods:

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

Then there are services that need to be restarted - the list is quite long & I would not know where to start with each one of them as they are more foreign to me than spoken-martian.

FInally, although mosh installs on the droplet:

"The locale requested by LC_CTYPE=UTF-8 isn't available here.
Running `locale-gen UTF-8' may be necessary.
[...]
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

But running that comand yields no change in behaviour. All this does not occur on 20.04.
Could we be dealing with a still flaky release?

Chiming in real late with a thought (am facing design decision in this realm). Under the assumption one controls all the applications:
1 - set up all applications with same master.key
2 - application acts as an API. Create user there, parent then populates child app with a copy of the user (and user.id would be synched !)
However, this does not synchronise logins. It is also debatable whether one wants those logins synchronised.
Assuming yes, has anyone implemented such a solution?

Posted in How to initialize datepicker in stimulus controller?

For anyone digging into this as of Rails 7, there is a stimulus 3 support issue to deal with here.

Presently it requires a pin to beta version
bin/importmap pin stimulus-flatpickr@beta

You will also need to have some css references, such as to the latest version
<link rel="stylesheet" href="https://ga.jspm.io/npm:flatpickr@4.6.9/dist/flatpickr.min.css">
otherwise the input field will be deemed as readonly...

Posted in Installing Tailwind with Rails 7

There are fine solutions that are CSS-only, that also fit in very well with the flexbox and viewport detection paradigms. I suggest those be investigated. [ one development mindset is to avoid JS if it can be done in CSS (separation of concerns, less dependencies, etc...) ]

That template was gold. Here's a gist that that extends that thinking, looking at setting up a basic working environment: https://gist.github.com/dvodvo/313bcb4da83030c48280fe76065da9e3

Posted in Hotwire Modal Forms Discussion

right now it essentially returns to the same URL (once clicked upon)

Posted in Hotwire Modal Forms Discussion

always value. But what happened to the download functionality. I frequently pause & re-wind; having the copy locally is time & bandwidth-friendly...

Posted in Deploy Ubuntu 20.04 Focal Fossa Discussion

*deployment hangs RAILS_ENV=development on assets precompile Rails 6.0.3.4 *

INFO [7e60e5e4] Running $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile as deploy@...243
 DEBUG [7e60e5e4] Command: cd /home/deploy/zappa/releases/20210110095959 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.6.1" RAILS_ENV="development" RAILS_GROUPS="" ; $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile )
 DEBUG [7e60e5e4]   error Couldn't find an integrity file
 DEBUG [7e60e5e4]   error Found 1 errors.
 DEBUG [7e60e5e4]   

========================================
  Your Yarn packages are out of date!
  Please run `yarn install --check-files` to update.
========================================


To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).

running yarn install --check-files either locally or in the file server does not change behaviour one iota (on the server it is pointless as the next deployment creates a new directory). Setting 'check_yarn_integrity' to false does not change the behaviour.

Now I have read that should be in the shared directory (append :linked_dirs, public/packs, node_modules) which make sense given the two directories can be a 200 MB bloat. Tried that... no happiness.
The github repositry states: ensure that the installed packages match the yarn.lock file. ; the VPS yarn.lock file is empty. Another assumption I have been working on is the environment; it could be that development mode

yarn install --check-files did finally populate the shared directory ([ahem] after I had polluted all sorts of other directories. That moved the process further... to another error.

LoadError: Could not load the 'listen' gem. Addgem 'listen'to the development group of your Gemfile
buuut... that was already loaded.

Error identical to running Running RAILS_ENV=development bundle install; but this returns a clue:

Gems in the groups development and test were not installed.

SO and rails repo (https://github.com/rails/rails/issues/24063) comments of moving the gem from the development block to the global block .
RAILS_ENV=development bundle install can now run (you'll see the various modules taking their time to compile (hundreds of MBs worth). Deployment can proceed.

so..
1 - ensure append :linked_dirs, 'node_modules', 'public/packs'
2 - if in dev mode, move listento general block.
3 - Run RAILS_ENV=development bundle install on server to feel safe.

Then question if you need the other dev block gems on the server and move those to the global block.
OK. I am not aware of how to install those deve/test gems remotely. Any suggestion is welcome.

Posted in Deploy Ubuntu 20.04 Focal Fossa Discussion

Notes on this guide
1 : the section for deployment, where you mention the block to edit, it ought to be stated that it should follow the line install_plugin Capistrano::SCM::Git otherwise bad ordering will make the cap commands fail.
2: I would suggest on the capfile configuration comment to include all files that you need to avoid being committed via gitignore (assuming not using environment variables), [often initializer] files with keys to things like s3, e-commerce, devise ...

Posted in How to use Hotwire in Rails Discussion

Read somewhere: 'Rails 6 defaults to using Webpacker for Javascript instead of the asset pipeline'
Turbolinks is dead. Rails 6.1, few hours later hotwire and one can manage javascript via the asset pipeline. Turbo [something]. A Phoenix was sighted.

Wait!

So what happens when one migrates an app from 5 to 6, then realizes this is hot and loads the gem.
What conflicts could arise?

Errant tangential thought:
God forbid Jack has a remote control over Chris's fan when he invokes editing a tweet.

Has anybody experienced yarn not finding flatpicker?

yarn add flatpicker
yarn add v1.22.4
[1/4] 🔍 Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/flatpicker: Not found".

Interesting curve on the road to sending a Twilio SMS. Running the command as per the send_text method suggested, ran the first time from localhost.

But somehow, after adjusting the method to be able to handle the API response, Rails 5 complains with:
ArgumentError (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true) I am certain the method is firing (because when the conditions are not met, the console prompt returns to a ready state & testing without the added line generates the SMS).

Thus, adding status_callback: update_twilio_reminder_url(reminder.user_id),to the method is hanging because it needs a defaulturl option. But which? certainly not action_mailer's? config.application.default_url_options? config.application.routes.default_url_options? On this point, the rails guide is as opaque as the error message...

Posted in Error Tracking with Errbit Discussion

I am trying to wrap around my head around the hooks. The first immediate hook is errbit knowing the application's github repository. The second is the airbreak.rb file where the app (and I assume all of its deploys) actually points to errbit application and its services. So I understand airbreak config... 'send my errors to errbit'. But why then does errbit need to know about to the repo?

A corollary question: if there are multiple deploys, say 'staging1' and 'staging2' are added, they will all be handled by errbit and show the non-traditional deploy name (unless stated in ignore_environments config line) ?

Another suggestion is a non-rails issue, but fundamental nonetheless: focus on the database queries themselves. A great suggestion I have held dear over the years is to ask "what are the critical queries an application may have?" (the most frequent one, the most valuable, the most calculation intense...) On that basis, with a knowledge of how databases index, one can often find a data structure that is more efficient than another (conception over optimisation). Large test data sets for different data structures allow to validate design choices. To me, that is the core of the onion...

Posted in In-App Navbar Notifications Discussion

Very useful and good pacing/progression of arguments.

Two questions.
1) the onClick handler is going to go to an object, so the page is going to be refreshed anyways. To make a counter decrement by 1, several options are available: one is to check the object and find Notification with equivalent object_id and type and recipient = current_user and update that. The other is to have routing as member and have the coffee script call `url: "notifications/#{id}/mark_as_read` and update there. I am not sure of which avenue is better (I believe the second may be faster), nor the proper syntax to generate the notification id in the url

2) you mentioned polling. Websockets would be the best solution for one with a server. This has two caveats. As a user, I have seen notifications be browser tab-dependant (I use a lot and do not always get notifications); it is a worry. In an exploratory phase (i.e. no significant traffic numbers), one could reason: 'let the user decide'. what would be a quick and dirty way to have a fa refresh icon update the notification status?

er... and testing rotating a second time needs production traffic to run if `notifempty` is set !

Add `this takes barely 5 minutes to read and complete` ;-). Concise badge. Also, your article should have a date on them (both created and updated); provides added insights as to potential gotchas from framework changes over time.

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

That may explain why I hit a small bump with the above. Editing the Capfile would then *not* need `require 'capistrano/bundler'`. Next time I deploy, I'll report back...

logo Created with Sketch.

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

© 2022 GoRails, LLC. All rights reserved.