Migrating from Devise to Rodauth, Rspec

If you want to read about migrating a basic Rails application from Devise to Rodauth, go to Basics. Removing Devise When writing controller or feature tests, you usually have a file in spec/support/devise.rb. It includes Devise test helpers, you can use sign_in @user in your RSpec tests. You can remove the file entirely: - RSpec.configure do |config| - config.include Devise::Test::ControllerHelpers, type: :controller - config.include Devise::Test::ControllerHelpers, type: :view - end Updating the specs Sadly, Rodauth doesn’t have an easy helper for the tests and recommends performing the authentication through the normal requests....

April 19, 2025 · Codefabrik GmbH

Migrating from Devise to Rodauth, Basics

Devise has been my go-to authentication library for as long as I can remember. Recently, though, I had requirements that were incompatible with Devise. Namely, to allow authentication both from a HTML frontend via session cookies, and via JWT from a mobile app. Apparently, Rodauth supports that use case and many more. This post explains the minimal steps to migrate from Devise to Rodauth in a Rails application, while the other posts of the series explain advanced topics when special Devise features were in use....

April 19, 2025 · Codefabrik GmbH

How to use Propshaft with Rails 8

How to use Propshaft with Rails 8 Recently, the first beta version of Rails 8 has been released, and with it, Propshaft has become the default asset pipeline. Propshaft works quite differently to Sprockets. Mainly, all compilation, minification und concatenation tasks are outsourced to separate gems. The asset pipeline itself is only responsible for loading the assets and fingerprinting them, so they can be cached indefinitely. By default, Propshaft is configured to serve assets from app/assets, lib/assets and vendor/assets....

October 1, 2024 · Codefabrik GmbH

Target class BladeRouteGenerator does not exist

Target class BladeRouteGenerator does not exist Uninstalling and upgrading Laravel packages may sometimes break an application. If you get the error Target class [Tighten\Ziggy\BladeRouteGenerator] does not exist. Try clearing the views cache: php artisan view:clear This should get rid of the error.

March 18, 2024 · Codefabrik GmbH

JSON POST-Request with the Ruby HTTPX gem

JSON POST-Request with the Ruby HTTPX gem Many of the most popular HTTP client libraries for Ruby are quite outdated. Some of them have been last released almost four years ago. Some of them no longer work with Let’s Encrypt certificates. And almost all of them are heavily depended on by other gems. The HTTPX tries to keep the best parts of the older gems, while supporting a wide range of protocols, proxies, compressions and authentication methods....

November 17, 2023 · Codefabrik GmbH

libv8_monolith.a: No such file or directory

libv8_monolith.a: No such file or directory When installing the mini_racer gem on certain systems, bundler complains that it can’t compile the native extensions because the library libv8_monolith.a is missing. This is caused by the lockfile not containing your current platform. It can easily be fixed by running bundle lock --add-platform x86_64-linux, adapting the last option to your actual platform. The next time bundler is run, the required libraries should be ready....

April 2, 2022 · Codefabrik GmbH

Migrating Rails 6 applications from webpacker to importmaps

Rails 7 will no longer ship with webpacker by default but will instead use importmaps. This is a much lighter solution for applications which mostly rely on external scripts. This post explains how to migrate an existing application from webpacker to importmaps. Installation Remove the webpacker gem from your Gemfile and add the importmap-rails gem instead. Next, remove the javascript_pack_tag line from your application layout in app/views/layouts/application.html.erb. To set everything up, run the importmap installer with the command ....

October 14, 2021 · Codefabrik GmbH

Unable to install libv8, therubyracer or mini_racer with bundler

This blog posts explains how to get rid of the installation error when installing therubyracer or mini_racer with bundler 2.2 ...

June 16, 2021 · Codefabrik GmbH

NameError: uninitialized constant ActiveRecord::DatabaseConfigurations:: ConnectionUrlResolver::URI

This blog posts explains how to get rid of the NameError when using the sinatra-activerecord gem with ActiveRecord 6.1. ...

March 31, 2021 · Codefabrik GmbH

ActiveRecord::StrictLoadingViolationError for ActionText::RichText

This blog posts explains how to get rid of the StrictLoadingViolationError when using ActionText. ...

December 14, 2020 · Codefabrik GmbH