For issues specific to the version 6.1 of Rails. If your question applies to Ruby on Rails in general, use the tag [ruby-on-rails]
Questions tagged [ruby-on-rails-6.1]
216 questions
43
votes
1 answer
The method `add_template_helper` does not seem to work in Rails 6.1
After updating my project to Rails 6.1 I get this error:
NoMethodError:
undefined method `add_template_helper' for ApplicationMailer:Class
In the documentation does not seem to be deprecated.

Daniel
- 4,051
- 2
- 28
- 46
27
votes
6 answers
Rails: How to delete a pending migration
I'm currently following the ruby on rails tutorial: http://guides.rubyonrails.org/getting_started.html.
I am trying to save data into the database. However, when I run: rails server I get the following error:
Migrations are pending. To resolve this…

Leslie Tate
- 550
- 1
- 6
- 18
24
votes
5 answers
undefined method `file_fixture_path' after upgrade to ruby 3 and rails 6.1
After upgrade to ruby 3 and rails 6.1 my tests break on the line
subject.avatar.attach(fixture_file_upload(Rails.root.join('spec', 'fixtures', 'images', 'avatar.jpg')))
with:
NoMethodError:
undefined method `file_fixture_path' for…

mingle
- 1,567
- 1
- 16
- 19
20
votes
1 answer
Rails 6.1.4 Deprecation warning: Rendering actions with '.'
I'm receiving a deprecation warning when running rails test. That warning being below. Any help is appreciated in identifying what I'm doing incorrectly.
(Edit: Side note, the render MUST break and return from the current controller call. I…

B-M
- 1,231
- 1
- 19
- 41
14
votes
2 answers
warning: URI.escape is obsolete when using paperclip in ruby 2.7.2
ruby - 2.7.2
rails - 6.0
paperclip - 6.1.0
I am getting following warning in my console, while using paperclip gem with ruby 2.7.2
/Users/***/.rvm/gems/ruby-2.7.2/gems/paperclip-6.1.0/lib/paperclip/url_generator.rb:68: warning:…

honey
- 981
- 6
- 19
11
votes
1 answer
NoMethodError undefined method `action_encoding_template' for Controller
I've stumbled upon strange error during #create action in one of my rails controllers:
NoMethodError
undefined method `action_encoding_template' for Controller
There is no clear way how to debug that.

LE-HU
- 631
- 5
- 17
8
votes
3 answers
Rails 6.1.5: uninitialized constant Mail::TestMailer
Why am i getting 'uninitialized constant Mail::TestMailer' error with "Rails 6.1.5 & Ruby 3.1.0" while working without problems "Rails 6.1.5 & Ruby 3.0.1" ?

togi
- 814
- 5
- 13
5
votes
2 answers
Ruby 3.0.4 with Postgres 14 throws segmentation fault
I have
Ruby 3.0.4
Rails 6.1.7
pg 1.4.5
postgresql 14.6
Here is my database.yml file
development:
adapter: postgresql
encoding: utf8
database: olio_development
username: postgres
password: password
pool: 5
host: 127.0.0.1
port: 5432
gssencmode:…

Suganya Selvarajan
- 962
- 1
- 11
- 33
5
votes
4 answers
Rails Model no longer available in initializer after upgrade to Rails 7.0
I have a Rails initializer (features.rb) that must access a model (Report).
Report.all.each do |report|
default_to_enabled(report&.feature_name)
end
This all worked perfectly with Rails 6.1 using Zeitwerk and defaults set for…

iconoclast
- 21,213
- 15
- 102
- 138
5
votes
1 answer
How to install expose-loader 3.0.0 with rails 6?
I still have a few dependencies on jQuery. With Rails 6 and Webpack it's required to expose jquery otherwise errors occur. I have been using expose-loader 1.0.3 for some time without issue but, if I upgrade to expose-loader 2.0.0 or 3.0.0 I…

hellion
- 4,602
- 6
- 38
- 77
5
votes
2 answers
Error after upgrading Rails to 6.1: uninitialized constant RSpec::Rails::Railtie::SourceAnnotationExtractor
Running rspec after upgrading Rails results in an uninitialized constant error: RSpec::Rails::Railtie::SourceAnnotationExtractor.
The backtrace points to the "rails_helper.rb" file.
I already attempted a bundle update rspec-rails.

SamuelLJohnson
- 599
- 3
- 16
5
votes
2 answers
Rails 6.1.1 doesn't load the webpacker created CSS files in production mode
this is my first time asking a question here, I hope I would explain my problem well.
In one of my recent tasks, I'm upgrading our app to Ruby and Rails (Ruby 2.6.6 > 2.7.2, Rails 6.0.3.2. > 6.1.1)
I had several issues along the way, upgraded some…

Pozithron
- 53
- 1
- 5
5
votes
1 answer
Rails route issue after upgrading to rails 6.1
After upgrading to Rails 6.1, I'm getting following error:
undefined method `find_script_name' for nil:NilClass
In this case the route is being used is root_path but getting this for many other routes too! routes.rb is as following (tried like this…

HungryCoder
- 7,506
- 1
- 38
- 51
4
votes
2 answers
How to open rails console for access multiple database in rails 6?
i have multiple databases in my project and i want to open rails console to access both databases.
currently i can fetch data of only one default database.
In other word, how to open specific database console?

Jigar Bhatt
- 4,217
- 2
- 34
- 42
4
votes
2 answers
how to redirect a form within turbo_frame?
I need to add a button that persists the data of the following form but that when pressing it resets the view and stays in it, without redirecting to the index of the controller, I have tried an ajax call but I don't know why it didn't work for…

cisco
- 165
- 1
- 8