Deploying a Rails app to cloud services using Docker and Kamal (a library for deploying apps containerized with Docker).
rails new APP_NAME -d postgresql -j esbuild -c bootstrap --skip-test
cd APP_NAME
# Edit this file | |
alias aliases="nano ~/.bash_profile" # usage: type `aliases` in Terminal | |
# Navigate to location | |
alias home="cd ~" | |
alias desktop="cd ~/Desktop/" | |
alias repos="cd ~/Documents/Repos/" | |
# Navigate to project directory | |
alias ds="clear && cd ~/Documents/Repos/design-system" |
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
INSTALL JAVA | |
$ sudo apt-get update && sudo apt-get install default-jre | |
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | |
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
$ sudo apt-get update && sudo apt-get install elasticsearch | |
$ sudo update-rc.d elasticsearch defaults 95 10 | |
$ sudo service elasticsearch restart | |
$ sudo service elasticsearch status |
<<APP>> change this variables |
<<USER>> <<APP>> change this variables |
RouteTranslator gem is wrapping the current locale assignment in an around_filter set_locale_from_url and then resets it to the previous value.
Devise has a FailureApp to deal with unauthenticated requests, and it uses I18n to build the flash message and the redirection URL. But at that stage, the I18n default locale is set and the messages and URL are not localized in the context of the request (i.e. if the request URL is in French, and the default locale of the app is English, Devise will redirect to the English URL with an english flash message).
This is a solution for propagating the application locale to the the Devise middleware.