55 questions
0
votes
0
answers
70
views
rails 8 Kamal setup fails
I'm not able to complete a production deployment with Kamal 2 and Ruby on Rails 8.0.2. using the video at https://kamal-deploy.org
When I run kamal setup, it produces:
ERROR Failed to boot web on [URL]...
0
votes
0
answers
28
views
Error on rails 8 deployment with Kamal / Docker on bundler psych gem
I'm trying to deploy a Rails 8 app to production for the first time using Kamal. There are no issues in development mode.
Tools:
rails 8
ruby 3.4.7
MySQL 8
In the log output:
...
...
0
votes
2
answers
78
views
Rails App, Auto loading files during initiliase phase
I have a Rails 8 app that is pretty bare boned.
I'm just setting up my dependency injection container, which registers relevant services here at:
config/initializer/command_bus.rb
The issue is that I'...
-4
votes
1
answer
59
views
PG::InsufficientPrivilege error using Digital Ocean's App Platform and a connected dev database for a Rails 8 app
I have a Rails 8 application using an attached dev database and I am deploying to the Digital Ocean App Platform. I can successfully build the application and when I get to the deploy step I see this ...
0
votes
1
answer
80
views
Problem with migrated rails 8 sprockets/importmap sprockets errors on app/javascript files
I upgraded an app from rails 5.2 to 8.0.4, still using sprockets to load all assets, but everything was working properly. I then added importmaps and migrated all my javascript files to importmap. I ...
0
votes
0
answers
69
views
Rails 8 migration: remove sprockets dependencies
I migrated my application to Rails 8 some time ago, and at the time noticed that it wasn't using propshaft, it was still running sprockets even though the Gemfile might suggest otherwise. I wasn't too ...
-1
votes
1
answer
161
views
Replicating Rails development environment functionality
Background: I'm using Rails 8 out of the box and this is my first time working with Propshaft.
Goal: Create a custom environment that behaves identically to Rails' default "development" ...
0
votes
0
answers
39
views
How to deploy(bundle) custom JS and Modules from Rails-Engine in Rails Application using Vite-Rails
Given the following setup:
Rails Gem with mountable Engine containing some common functionality using Ruby- and Javascript-Code. Javascript is mainly used in Stimulus-Controllers
Rails 8 Application ...
0
votes
2
answers
73
views
How to pre-compile css for rails 8 and activeadmin version 4
I am running rails 8 and active_admin version 4.0.0-beta16 and
I managed to update app/assets/stylesheets/active_admin.css
with this content:
@import "tailwindcss";
The CSS works well ...
-5
votes
2
answers
184
views
"File unchanged! Either the supplied flag value not found or the content has already been inserted!"
I am working on a Ruby on Rails 8.0 application with Ruby 3.4.5 and the factory_bot_rails 6.5.0 gem. When I run rails generate model MyObject some_string:string, the generator creates the migration, ...
0
votes
0
answers
54
views
Can a wildcard route be used for the :show action in a rails resource?
I would like to build resource route for a resource that has slash-delimited IDs. The routes would look something like this where *path takes the place of :id
resources GET /resources(.:format)
...
0
votes
0
answers
175
views
Rails 8 importmaps following Rails 6 upgrade
I just can't quite get javascript working in Rails 8 with importmaps. I have upgraded from Rails 6.
I am getting this error:
Sprockets::FileNotFound in Posts#show
Showing /Users/Bazley/Rails/myapp_8/...
1
vote
1
answer
502
views
Where do I add styles when working with Tailwind 4 and Rails 8
Environment:
Rails 8
Tailwinds 4
I have the following:
tailwind.config.js file:
module.exports = {
content: [
'./app/views/**/*.{html,erb,slim}',
'./app/helpers/**/*.rb',
'./app/assets/...
0
votes
0
answers
145
views
Rails caching with both Solid Cache and Memcached/Redis – case `rate_limit`
Rails 7.1 introduced Solid Cache as a default cache store, and Rails 7.2 introduced native rate limiting.
In my Rails 8 application in production environment, I'm already using :solid_cache_store as ...
0
votes
0
answers
128
views
Deployment Rails 8 Applications To Ubuntu 24.04 Server
For my previous Rails 7.1 application, on an Ubuntu 22.04 server, I used Nginx.
In Rails 8, the Dockerfile has been upgraded to include a new proxy called Thruster, which sits in front of the Puma web ...
1
vote
0
answers
62
views
Changing Rails cache serializer from Marshal to message_pack
I'm trying to change the cache serializer in my Rails 8.0.2 app from Marshal to MessagePack. However, I'm running into a problem when I'm executing my test suite.
Here's what I had in my test ...
1
vote
0
answers
92
views
Upgrading to Rails 8: Cache error (Singleton cannot be dumped)
I'm upgrading a Ruby on Rails app from Rails 6.1 to Rails 8.0.2.
I've hit a problem with some methods that use Rails cache. These methods worked fine on Rails 6 but throw an error - singleton can't ...
1
vote
0
answers
215
views
ActiveAdmin 3.3.0 DELETE actions not working with Rails 8.0.2
I'm having an issue with ActiveAdmin 3.3.0 in my Rails 8.0.2 application where DELETE actions are not working. When an admin user clicks the "Delete" link, the application performs a GET ...
1
vote
0
answers
54
views
Performance benefit from using custom columns to store association metadata on PaperTrail versions when using Postgres and JSONB object columns?
We are using the Paper Trail Gem to track versions on multiple models in a Ruby on Rails 8 app. We use Postgres, and thus set up the object and object_changes columns on the versions table as JSONB:
...
1
vote
1
answer
117
views
Rails uninitialized constant error only in production
I get this error when I try to start server in production mode
=> Booting Puma
=> Rails 8.0.1 application starting in production
=> Run `bin/rails server --help` for more startup options
[...
0
votes
1
answer
138
views
Rails counter cache for has_one :through on Rails 7 and 8
I am struggling to get a counter cache working on a has_one :through and running into some weird behaviour. I want to have a counter_cache on the Company model that caches the number of associated ...
0
votes
0
answers
217
views
How do I suppress rails 8.0 'rails/console/app' deprecation warning
In a rails 7.2 app I am seeing the following deprecation warning:
DEPRECATION WARNING: `rails/console/app` has been deprecated and will be removed in Rails 8.0.
Please require `rails/console/methods` ...
2
votes
0
answers
89
views
Hotwire Native Android ActionBar color
I have a Rails 8 app that I am building mobile apps for using Hotwire Native. I already changed the color of the bottom tab bar on Android, and I want to change the top navigation ActionBar color. The ...
0
votes
0
answers
45
views
How to generate single-use URLs for blobs in Rails?
The Rails 8 Guide states:
By default, Active Storage assumes private access to services. This means generating signed, single-use URLs for blobs. If you'd rather make blobs publicly accessible, ...
1
vote
1
answer
102
views
Why does my rails 8 app create these mysterious annoying files?
After I start my laptop, some mysterious files and folders appear at the Rails root folder of my application.
$ sudo ls -lR backend/
backend/:
total 4
drwxr-xr-x 3 root root 4096 Mar 11 10:05 tmp
...
0
votes
0
answers
88
views
Rails Turbo frame preventing full page reload
I have Rails app with buttons in a partial inside a turbo frame, they are supposed to trigger a flash message. The message shows up and the action takes affect if I refresh. It was working before I ...
0
votes
1
answer
181
views
How to automatically load model schema on rails console start?
I have a configuration in .irbrc that would auto connect to the database when loading rails console:
# ~/.irbrc
if defined? Rails
# connect to db to avoid seeing `User (call 'User.connection' to ...
0
votes
2
answers
147
views
config_for() parses the ERB of whole file, there are cases when one environment is not able to parse the ERB snippets of other environment
On a newly created Rails app. I create an app configuration/settings file:
# config/app.yml
test:
key: "VALUE"
development:
key: "<%= Rails.application.credentials.section[:key] ...
1
vote
0
answers
160
views
How to combine lots of static JavaScript files into one big one using Rails and Propshaft?
I just created a brand new Ruby on Rails 8.0.1 app with Propshaft included. I got the SCSS part working but I can't seem to get the JavaScript part working.
Unlike with most other apps, I have only a ...
1
vote
2
answers
326
views
Rails 8.0.1 upgrade, railties-8.0.1 gives warning: already initialized constant STATS_DIRECTORIES
Just upgrading a Rails 7.2.2 app to Rails 8.0.1. Before the upgrade, all tests run cleanly. App was upgraded to ruby 3.4.2 just before (and all tests passed with no warnings). After upgrade, this ...
0
votes
1
answer
801
views
FontAwesome Pro in Rails 8 with importmap and propshaft
I am having a difficult time getting FontAwesome Pro to work with propshaft, importmap and other Rails 8 changes.
I'm using tailwindcss 3 with an assets directory that looks like:
app
assets
...
1
vote
1
answer
163
views
ActiveRecord::ConnectionNotEstablished tries local PostgreSQL socket instead of Heroku DB
I have a Rails 8.0.1 application (Ruby 3.3.4) that I’m deploying to Heroku. The code pushes successfully, but whenever I run:
heroku run rails db:migrate
I get this error:
ActiveRecord::...
1
vote
1
answer
139
views
Heroku not running database migrations for Rails app
I have a Rails 8 app deployed to Heroku. The app was working with the Postgres database connected. I pushed code for an automatic deploy. The deploy said it worked, but I am getting a 500 on some ...
1
vote
0
answers
240
views
Rails 8 with kamal 2 wildcard certificate possible?
Is there way to use a wildcard certificate with Rails 8 deploying with Kamal 2 or do I have to deploy with capistrano with nginx or apache?
3
votes
1
answer
2k
views
How to use SCSS in a rails 8 project?
I just started a new Rails 8 (Ruby 3.4.1) project with the new propshaft asset pipeline and I can't get SCSS to work. I've tried adding the sassc-rails gem to my gemfile, like in my recent Rails 7 ...
0
votes
1
answer
286
views
Custom Bootstrap color theme with Rails 8
I created a new Rails 8 app with bootstrap css:
rails new my_app -c="bootstrap"
and Bootstrap worked out of the box. It created an application.bootstrap.scss file that included:
@import '...
1
vote
2
answers
332
views
How to properly import a modular JS library in Rails using Importmap (case date-fns)?
In my Rails 8 app I'm using Importmap and I would like to use date-fns in an appropriate manner given only one functionality and a couple of locales from that JS library are needed. Below is what I ...
0
votes
0
answers
67
views
Does Mongoid support has_one or belongs_to through relationships?
Mongoid does not seem to support has_one or belongs_to with through.
class Customer
has_one :salesperson
has_one :manager, through: :salesperson
end
class Salesperson
has_one :manager
end
...
0
votes
1
answer
236
views
ActiveStorage direct upload gives SGID with InvalidSignature (mismatched digest)
I'm working on a new Rails 8 site in local development. I'm using ActiveStorage connected to R2 to upload images. I'm currently integrating EditorJS, specifically for editing the Post model.
When I ...
0
votes
1
answer
45
views
Removing field value after User changes the value of a related field (RAILS)
I am trying to automatically remove the assigned value of the column name "table_number" if the User changes the value of the column_name "status" to "no" in the RSVP ...
2
votes
0
answers
643
views
Setting up Solid Queue jobs on a dedicated server with Rails 8 + Kamal 2
I just upgraded my Rails app to Rails 8 and switched to Kamal 2 + Digital Ocean from Heroku. I have quiet a lot of jobs running on my app so I first tried to keep the puma plugin to run them on the ...
0
votes
1
answer
245
views
Turbo Stream broadcast error in Rails 8.0.1
I have a new Rails 8.0.1 app
In an index.html.erb page I code:
<%= turbo_stream_from "test" %>
<div id="message">
<p>hello</p>
</div>
In server ...
0
votes
0
answers
225
views
Can't import anything from the Flowbite lib in a Rails 8 app (module 'flowbite.turbo.min.js' doesn't provide an export named: '...')
The stack is: RoR 8 + turbo-rails + propshaft + importmaps-rails + tailwindcss-rails + Flowbite.
I have completed the integration steps from the Flowbite guide to add Flowbite to my Rails app. At ...
2
votes
1
answer
695
views
Rails 8 accepts_nested_attributes_for in a model is not working the same as Rails 7
I decided to rewrite one of my applications in Rails 8. I call myself a hobbyist developer but have been using rails since 0.9. The app is basically a double entry accounting application. I wrote it ...
1
vote
0
answers
62
views
Devise gem error in test environment: serialize_from_session gives error "wrong number of arguments (given 10, expected 2)"
I just updated my app to rails 8 with the newest version of Devise and hotwire turbo. When running tests with Capybara/Rspec I'm seeing certain form submissions fail with a 500 error from inside of ...
2
votes
0
answers
131
views
tippy.js: "Uncaught ReferenceError: process is not defined" when running with importmaps in Rails 8 with no bundler
I've updated my application to rails 8 running with propshaft and the importmap-rails gem instead of webpacker. I am still using yarn to manage dependencies and pinning them in my importmap. Works ...
0
votes
1
answer
525
views
Rails not compiling new TailwindCSS classes in development
I have a rails app that was generated using
rails new new_app --css tailwindcss -j esbuild
This created a procfile that contains this stuff
web: env RUBY_DEBUG_OPEN=true bin/rails server -b 0.0.0.0
...
0
votes
0
answers
55
views
Rails 8: Why does my link point to #show not #destroy? [duplicate]
I am adding a simple log out link to my menu bar. It should fire SessionsController#destroy:
class SessionsController < ApplicationController
#...
def destroy
terminate_session
...
3
votes
1
answer
505
views
rails 8.0 upgrade remove redis dependency
We are planning to upgrade our application to Rails 8.0 and take advantage of the new Solid* features that allow us to remove the Redis dependency. I've done some searching and cannot find any upgrade ...
0
votes
1
answer
61
views
How do I ensure resource and nested resource are singular?
I have a DashboardController. This is the page where the user views their profile, settings, etc.
It makes sense for me that dashboard be singular.
For now, the dashboard is also the root. So long as ...