Ruby on Rails 6 is the latest version of Ruby on Rails, "an open-source web framework that's optimized for programmer happiness and sustainable productivity."
Questions tagged [ruby-on-rails-6]
2084 questions
5
votes
3 answers
csrf_meta_tags and form_for generate invalid base64 on Heroku
I am using ruby 2.7.1 and rails 6.0.3.4 and hitting the following error whenever I try to call csrf_meta_tags or form_for
2021-02-01T07:25:10.058892+00:00 app[web.1]: [9c50e00c-9868-45dc-89d8-1ec8f42d56ab] ActionView::Template::Error (invalid…

cecomp64
- 657
- 5
- 10
5
votes
1 answer
Rails 6 not recompiling SCSS using Sprocket / Assets in development
I have a Rails 6 app I return to sporadically. It's using webpacker for the JS, and Sprockets for the CSS (as I think is default). If relevant, I'm developing on WSL - the files are in the Ubuntu filesystem, Rails is running in Ubuntu, editing is…

Chowlett
- 45,935
- 20
- 116
- 150
5
votes
1 answer
Papertrail: records with nil whodunnit values and object_changes in logs
I've set papertrail to only record changes containing a whodunnit value/when an admin makes a change by using the below condition in my model:
has_paper_trail if: proc { |model| PaperTrail.request.whodunnit.present? }
However I've noticed there are…

L457
- 1,002
- 1
- 13
- 33
5
votes
2 answers
Rails Active Storage Local attachemnt failing with cryptic errror: uninitialized constant Analyzable
ruby '2.7.1' / rails 6.0.3.2
I can't get local active storage attachements to work. Here is my setup:
I have run:
$ rails active_storage:install
$ rake db:migrate
Model schema
create_table "amazon_uploads" do |t|
t.string "status"
…

Andrew
- 942
- 10
- 26
5
votes
1 answer
Change the log location (i.e., `LogDevice`) in a Ruby on Rails (version 6) application
Rails 3 seems to have had a property in config for changing the output location of Rails.logger, config.log_path. That's been deprecated. Looking at a Rails 6 application, is this the way to do that now? Or did this config property get moved to…

cdmo
- 1,239
- 2
- 14
- 31
5
votes
2 answers
Uncaught ReferenceError: $ is not defined in Rails 6 jquery webpacker
I am using Rails 6.0.3.2, ruby 2.7.1, yarn 1.22.0.
I am trying to do normal UJS stuff, and this is the error I am getting:
VM125:1 Uncaught ReferenceError: $ is not defined
at :1:1
at processResponse (rails-ujs.js:283)
at…

marcamillion
- 32,933
- 55
- 189
- 380
5
votes
1 answer
Rails 6 - InvalidAuthenticityToken on Heroku
I've seen no answers on SO so far that don't answer this without suggesting to just disable it (which I don't want to do).
Locally, everything works, but deployed to producton on Heroku I'm getting InvalidAuthenticityToken.
From everything I can…

Tallboy
- 12,847
- 13
- 82
- 173
5
votes
2 answers
How to change Rails application config on a per-spec basis?
Our Rails app has a custom 404 and 500 pages:
match '/500', :to => 'errors#internal_server_error', :via => :all
And we have some specs to make sure it works.
In test.rb:
Rails.application.configure do
config.consider_all_requests_local =…

B Seven
- 44,484
- 66
- 240
- 385
5
votes
3 answers
Rails 6 Heroku Devise error ActiveSupport::MessageEncryptor::InvalidMessage
i'm trying to deploy my Rails 6 app to Heroku, this is the first time I do in Rails 6 bit I'm getting this output from heroku:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default…

Mario Gómez
- 51
- 1
- 2
5
votes
1 answer
Unable to deploy TailwindCSS on a Rails 6 app to Heroku
I'm currently trying to deploy my rails 6 application to Heroku. I tried the answer in a post about a similar issue but had no luck.. I'm not sure where the error is coming from since the styles work well on development but break when pushing to…

Steven Aguilar
- 3,107
- 5
- 39
- 89
5
votes
1 answer
Rails 6 warning: Overwriting existing method .fetched_state
Rails 6.0.2.1
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
my ArticleDir class has 2 scopes:
scope :active, -> { where(active: true).where(expired_on: nil) }
scope :fetched_state, -> { where(state: ArticleDir::FETCHED.to_s) }
and a…

willyab
- 167
- 1
- 10
5
votes
1 answer
Best way to import single css files in a rails 6 views using webpack
So i already imported the application.scss with the tags
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
and it works
however i…

André Kraüss
- 73
- 2
- 8
5
votes
0 answers
Having trouble setting up Bootstrap + jQuery + easyAutocomplete in Rails 6
I have been reading articles/forums and followed some guides on how to set it up however I'm still having trouble running bootstrap and jquery.
Installed bootstrap, jquery and easyAutocomplete via yarn, after this I have proceeded to set up my…

Adrian0012
- 175
- 1
- 5
5
votes
1 answer
Rails custom ActiveRecord::Type fails when using `class_name` in has_many :through association
I'm using KSUIDs as a replacement for UUIDs in my Rails app. michaelherold/ksuid-ruby ported KSUIDs to Ruby and implemented them as ::ActiveRecord::Type::String. Everything is working great except one little bug when using has_many :through…

mattes
- 8,936
- 5
- 48
- 73
5
votes
0 answers
"webpack-dev-server" command not found - Docker with Rails 6
I'm currently working on "dockerizing" a Rails 6 app with MySQL as backend/admin-panel with an Angular 8 app as frontend for users. I tried to run both containers with docker-compose and the frontend works perfectly but the backend has a problem.…

Marion
- 51
- 2