Phusion Passenger changed the way how it gets restarted several times. Through the project's history, these all were valid:
sudo passenger-config restart-app /path/to/app
passenger-config restart-app /path/to/app
You should not need to know which one to use. Instead, the capistrano-passenger gem will choose the appropriate restart mechanism automatically based on your installed the passenger version.
Add to your
We currently test most of our gems on Travis CI, but want to migrate those tests to Github Actions. This is a step-by-step guide on how to do this.
Note that this guide requires the gem to use gemika.
git checkout -b ci
mkdir -p .github/workflows; bundle exec rake gemika:generate_github_actions_workflow > .github/workflows/test.yml
On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and versions 0.3.x (required for Rails 3.2) can no longer be installed on Ubuntu 20.04. Trying this either leads to errors when compiling the native extension, or a segfaults when using it.
For Rails 4.2, mysql2 version 0.4.10 seems to work okay.
To install it, you have to switch the mysql2 gem to our fork. In your Gemfile, change mysql2 to either
gem 'mysql2', :git =>'https://github.com/ma...
The idea behind VCR is that is performs real HTTP requests and logs the interaction in a .yml file. When you run the test again, requests and responses are stubbed from the log and the test can run offline.
It's a great way to mock network requests to an external service without going through the pain of logg...
We released a new version of our gem geordi
auto_update_chromedriveras global setting option to automatically update chromedriver before cucumber
geordi cucumber --modifiedcommand, that corrupted filenames like:
No such file or directory tures/pages.feature
Versions 2.9.0, 2.99.0 and 3.0.0 of our gem Spreewald have been released.
an email should have been sent with:does now support wildcards (
*at the end of a line to ignore the rest of the line,
*as single character in a line to ignore multiple lines). The step also has better error messages if an email could not be found.
show me the emailsgot an option to display only the email headers. Additionally, a new step `show me the email( header)?s...
It sometimes happen that a database dump, that would want to insert into your development database, does not match the current schema of the database. This often happens when you have an old dump, but your current setup is up to date with the the master.
Hint: In most cases it is sufficient to delete and recreate the local database in order to import the dump. If any problems occur, proceed as follows:
psql some.dump > some.dump.plain
We released a new version of our gem QueryDiet.
You can pass whether to use a nonce for style and script tags.
Note that the key must be a symbol like in the example below, otherwise it defaults to
<%= query_diet_widget(nonce: true) if Rails.env.development? %>
In your content security policy initializer of...
Versions 2.3.0 and 2.3.1 of our gem Cucumber Factory have been released.
Both single and double quotes are supported.
Given there is a user with the avatar file:"path/to/avatar.jpg"
The sidekiq-rate-limiter gem allows rate-limiting Sidekiq jobs and works like a charm. However, it needs to be integrated on a per-worker basis.
If you want to limit a whole queue instead, and if your requirements are simple enough, you can do it via a Sidekiq middleware yourself.
Here is an example that limits concurrency of the "mailers" queue to 1. It uses a database mutex via the [with_advisory_lock](https://github.com/ClosureTree/wit...
If you're using the webdrivers gem and VCR together, depending on your configuration, VCR will yell at you regulary.
The webdrivers gem tries to update your webdrivers on your local machine. To do so, it checks the internet for newer versions, firing an HTTP-request to e.g. https://chromedriver.storage.googleapis.com
You can "fix" this in multiple ways:
Update your drivers on your machine with
RAILS_ENV=test rake webdrivers:chromedriver:update
Ignore the driver update-URL in your ...
Version 2.2.0 of our gem Cucumber Factory has been released.
(Given "Bob" is a user) And "Bob" has the email "email@example.com" and is subscribed
(Given "Bob" is a user) And the user above has these attributes: | name | Bob | | email | firstname.lastname@example.org |
This is an extract from the linked article. It shows an approach on how to implement encrypted passwords with the AWS Key Management Service (KMS).
For most applications it's enough to use a hashed password with a salt (e.g. the gem devise defaults to this).
Generate hash as hash of password + salt.
Encrypt the hash with a public key from KMS (you can store the public key in your server code).
In your database sto...
Rails 5.2+ supports "verbose query logs" where it shows the source of a query in the application log.
Normally, it looks like this:
User Load (0.5ms) SELECT "users".* FROM "users" WHERE ... ↳ app/controllers/users_controller.rb:42:in `load_users'
However, you may encounter ActiveRecord's LogSubscriber as the source for all/most queries which is not helpful at all:
User Load (0.5ms) SELECT "users".* FROM "users" WHERE ... ↳ activerecord (220.127.116.11) lib/active_record/log_subscriber.rb:100:in `debug'
If you use
transactional_fixtures or the database_cleaner gem with strategy
after_commit callbacks will not be fired in your tests.
Rails 5 has a fix for this issue and no further action is needed.
Add the gem test_after_commit to your
test group in the Gemfile and you are done. You don't need to change the database strategy to
deletion (which might...
Selenium allows you to log all requests to the Webdriver API. Therefore add the following line to e.g.
Selenium::WebDriver.logger.level = :debug
If you want to see the output of the driver itself, here is an example on how to enable Chromedriver logging.
When you run a command like
bundle exec cucumber --format=pretty features/some.feature you will see the API communication before the step is printed (here you see the log for the step
And I press "Save").