235 questions
0
votes
0
answers
66
views
Migrating existing data from Paperclip to Active Storage in Rails 6.1 without re-upload
We are migrating our codebase from paperclip to active storage
Below is the example of how we use paperclip:
has_attached_file :logo,
styles: { small: "x36", medium: "x108", ...
0
votes
0
answers
16
views
Rails CKEdior toolbar not showing any icon
I have recently upgraded rails version from 4 to 6.1.7.8, my ckeditor version is 4.3.0, its deployed on Heroku.
now ckeditor toolbar is not showing icons.
ckeditor toolbar screenshot
I Inspected the ...
1
vote
2
answers
217
views
How can I fix the fix issue upgrading my Rails 5.2 to 6.1.7.8
My ruby version is 3.0.3, bundler version is 2.5.18
Error:
ActionView::Template::Error admin/home#index
wrong number of arguments (given 4, expected 0..1)
Error in line:
<%= form_for :business, url:...
0
votes
1
answer
104
views
Apache Passenger Rails vhost failing after Ruby and Rails upgrade
I recently upgaded three Rails applications: UAM, Proposals, and Projects from Rails 5.2 to 6.1.7.7 and from Ruby 2.7.4 to Ruby 3.3.1.
The three applications were previously split from the same ...
0
votes
0
answers
143
views
rails 6.1 inconsistent behavior when using framwork_default_6_1.rb vs load_defaults = 6.1
I am upgrading my project from 6.0 to 6.1 and in my project, I have
config/initializers/new_framework_defaults_6_0.rb
# Be sure to restart your server when you modify this file.
#
# This file contains ...
0
votes
0
answers
73
views
rails cancancan upgrade 3.0.2 -> 3.5.0 issue
ruby 2.7.8
rails 6.1.7.7
cancancan 3.5.0
I have upgraded cancancan in favor of upgrading rails version to 6.1.7.7, but now ability file is behaving really weird specially the ones with STI. I have to ...
1
vote
1
answer
58
views
How do I handle associations in Ruby on Rails when the JOINS involve more than 2 tables?
I'm working on a Ruby on Rails server (v6.0.1) and I'm looking for cleaner ActiveRecord joins when the join involves three tables. Here's a barebones reproduction of five models under consideration to ...
0
votes
1
answer
124
views
Upgrading from Rails 2.7 to Ruby 3.0 causes issues in schema:load
I'm getting the following error on command line:
$ RAILS_ENV=test bundle exec rake db:schema:load
rake aborted!
ArgumentError: wrong number of arguments (given 3, expected 2)
/Users/kamil/Sites/pz/...
2
votes
0
answers
84
views
Could not find an executable /home/ubuntu/.phantomjs/2.1.1/x86_64-linux/bin/phantomjs that matched the requirements '>= 1.8.1', '< 3.0'
Cliver::Dependency::NotFound:Could not find an executable ["phantomjs"] on your path
I'm doing scraping/processing for some of my data using capybara. I have following gem installed
gem '...
0
votes
1
answer
200
views
Rails6 New app Postgres Database Connection Issue Peer authentication failed for user
I'm using rails 6.1 and ruby 3.1.1 on ubuntu 22.04
I've started a new rails app using Postgres: rails new lmt --database=postgresql
I also ran gem install pg
I have postgres on my local machine and ...
0
votes
1
answer
173
views
How do I determine the cause of a ActionView::Template::Error (SyntaxError: [stdin]:15:1: unexpected indentation)
I have a rails app and I had to revert a lot of commits. Now, when I try to view the app locally localhost:3000, I get an error I haven't seen before.
Processing by MainController#index as HTML
...
0
votes
1
answer
119
views
Rails How to get Javascript working without webpack
I'm running rails 6.1.7.6 and ruby 3.1.1
I'm set up a new rails app on heroku. I tried for two days to get webpack working but I couldn't. I followed many threads, but it kept saying I needed to ...
0
votes
0
answers
52
views
jquery issue in Rails 6 project
I have facing issues of jquery in my rails 6 project. I've attached the picture of my errors enter image description here
Ruby version is 2.7.6 and Rails version is 6.1.3. And I'm using asset pipeline ...
0
votes
1
answer
112
views
Rails connection switching issue
I use connection switching in AA backend. Depending on session i switch to the archive db. The problem is that calling ActiveRecord::Base.connected_to with database key switches the connection forever,...
0
votes
1
answer
65
views
Rails form_for required on select field not working
I'm using rails 6.1 and 'ruby 3.1.1`
In a form, using form_for, I have a select field that is using :required => true, but it is not working. The page submits without prompting me to complete that ...
0
votes
1
answer
82
views
Rails Heroku How to Tell if an Image File Exists in the
I'm using rails 6.1.4 and ruby 3.1.1
My app is on Heroku. I have several images in my assets/images directory, but I cannot get some of them to show when I deploy to live. Other images in the app ...
1
vote
2
answers
257
views
Rails 6.1 | Is there a way to check which associations have already been joined to a scope?
I have a little framework for dynamically constructing queries in rails (v6.1.7.3) based upon a json request from the front-end. As the use-cases keep growing, one thing that has been a bit of a pain ...
0
votes
1
answer
68
views
Rails Rake Task Not Seeing Model When Using NameSpacing for model relationships
rails 6.1.4 ruby 3.1.1
I have a sub-directory in my app: living_muay_thai I had a couple problems with my app because I was using the namespacing like so: LivingMuayThai::Student in the models. With ...
-1
votes
2
answers
461
views
undefined method `html_fallback_for_js' in ActionView::Base
I have recently upgraded a project to ruby 3.2.2 and rails 6.1
I am having issues with ActionView::Base. With the recent upgrade, I need to pass 3 arguments to ActionView::Base.new instead of 2. From ...
0
votes
0
answers
36
views
Heroku Rake Does Not See Namedspaced Model In Rake Task
I'm using rails 6.1.4 and ruby 3.1.1
In my app I have a section of it in a sub-directory: living_muay_thai/. I've created a rails task to populate a table with specific data. It works perfectly fine ...
0
votes
1
answer
49
views
Rails Console How do I get records in a many to many relationship
rails 6.1 ruby 3.1.1
I have a many to many relationships inside a sub-directory (namespaced) ...living_muay_thai. I have three tables: students, levels, and student_levels. I have records created in ...
0
votes
1
answer
48
views
unable to start the rails server without showing any error it got abored
I did brew update, without any errors all the brew libraries got updated.
After then when I start the rails server with any error it got aborted.
project_path git:(develop) ✗ bundle exec rails server -...
4
votes
1
answer
248
views
has_many association .build is not saving object in DB for Rails 6.1
I'm upgrading to Rails 6.1, and have the following associations in my model
class Product < ApplicationRecord
has_many :classifications, dependent: :destroy
has_many :order_lines, dependent: :...
0
votes
1
answer
75
views
Rails how do I make rails go to an index page in a sub-directory without a controller?
I'm using rails 6.1.4 and ruby 3.1
I have a sub-directory inside my rails app, call it /foo
I've worked with rails some, but I've never done this. I want to create a landing page at .../foo/index.html....
1
vote
1
answer
50
views
Many to Many Models Creating Records Via Console is not Working
I'm using: rails 6.1.4 and ruby 3.1.1p18
It's been a minute since I've played with a many-to-many association in rails and I'm a bit lost on this one. Any help/tips will be greatly appreciated.
I'm ...
0
votes
1
answer
316
views
Rails 6.1 migration. add_reference got wrong number of arguments (given 3, expected 2)
This is the weirdest thing...
I did this in my migration
class AddImmuneVaccineToImmuneRecord < ActiveRecord::Migration[6.1]
def change
add_reference :immunisation_records, :immune_vaccine
...
-1
votes
1
answer
235
views
Rails 6.1 — add `importmap-rails`, gem bundles but methods unavailable
Ruby: 3.1.2, Rails 6.1
Trying to add gem importmap-rails to an existing Rails 6.1 app.
The gem bundles, but neither the rake importmap:install task nor the gem helper method <%= ...
-2
votes
2
answers
1k
views
Rails New 6.1 app unable to process any request besides default screen: Webpacker::Manifest::MissingEntryError
On a brand new rails 6.1.7.4 app, I'm getting the following error when making a request to any page besides the default "Rails::WelcomeController#index" screen:
Webpacker::Manifest::...
0
votes
1
answer
467
views
wrong number of arguments (given 2, expected 1) redis catch store
When I start rails server locally (rails 6.1.3.2, ruby 3.0.0) with this configuration in develompent.rb
config.active_record.cache_versioning = false
config.cache_store = :redis_store, "redis:...
2
votes
0
answers
45
views
Delete Functionality with span tag and link_to is not working. It goes to show action instead of destroy - Administrate 0.16.0 and rails 6.1
I am using Administrate gem version 0.16.0 and my Rails version is 6.1.3.1
In the listing of my records, I have a trash icon on click of which record should be deleted. But somehow it sends a GET ...
0
votes
0
answers
248
views
Upon upgrade to Rails 6.1 my postgres database is no longer accessible
I'm addressing some vulnerabilities that were identified by one of our automated systems. Basically, it just recommends dependency updates to mitigate CVE vulns. As a result, I had to upgrade Rails ...
0
votes
2
answers
355
views
validation_inclusion_of rspec test case is returning ArgumentError
Let's consider a class with definition as shared below:
# a_type :string
class Foo < ActiveRecord::Base
enum a_type: { fir: 'first', sec: 'second' }
validates :a_type, presence: true, ...
0
votes
1
answer
462
views
Getting a NameError: uninitialized constant error upgrading to Rails 6
I am upgrade ruby to ver 3.1.3, rails ver 6.1
And I got error NameError: uninitialized constant
My folder tree:
- app
|- models
|- area.rb
|- area
|- search.rb
|- constants.rb
In ...
1
vote
0
answers
253
views
Why adding a fulltext index in a MySql table would fail?
I have a ruby on rails project which is using a mysql database.
I try to add one fulltext index upon one of my model for 2 attributes (name & body).
I did the following migration:
def change
...
5
votes
2
answers
813
views
Ruby on Rails update triggered ArgumentError in Mailer functions
We have recently migrated our codebase from Ruby 2.7.x and Rails 5.2.x to Ruby 3.2.2 and Rails 6.1.7.3. Previously, our mailers were defined like this:
class ApplicationMailer < ActionMailer::Base
....
0
votes
1
answer
359
views
Url / Path helpers not working after upgrade to Rails 6.1 from 6.0
After having upgraded to Ruby 3.0.6 and, subsequently, to Rails 6.1.7.3, we are having issues with all the URL helpers used in views.
They all fail with the error:
ActionView::Template::Error:
...
0
votes
1
answer
644
views
Testing mailers with Rspec and factory_bot
Hey guys, i need help, am new to testing and am testing my mailer but i do not understand y am getting this error when i run my tests.
'expected ActionMailer::Base.deliveries.size to have changed by 1,...
1
vote
2
answers
2k
views
ArgumentError (wrong number of arguments (given 1, expected 0)) After Upgrading to Ruby on Rails 6.1
I'm upgrading my open-source Ruby on Rails app from Rails 6.0.x to Rails 6.1.x
The upgrade went fine, except now I get an error from an async ActiveJob that fetches RSS feeds. When my app is deployed ...
2
votes
1
answer
159
views
how to solve extra `table` & `modifiable` merging issue while while json parsing as OpenStruct
JSON.parse(response, object_class: OpenStruct) rescue response
My rails application has above line of code which is causing an weird issue. Here response is coming from an external API call and looks ...
1
vote
1
answer
327
views
Struggling with Turbolinks and CSP to render a partial
I am using Rails 6.1.7 with turbolinks and CSP nonce based.
Here is my CSP config :
policy.default_src :self, :https
policy.font_src :self, :https, :data
policy.img_src :self, :...
0
votes
0
answers
139
views
wicked_pdf download error in the production server in rails 6 application
In a Rails 6 application, the wicked_pdf was working fine in the local server. It is downloadable, but in the production server it raised issue. Here is the code
controller.rb
def show
respond_to ...
1
vote
1
answer
534
views
ArgumentError: Job arguments to CarrierWave::Workers::ProcessAsset must be native JSON types
I would like to become more closely aligned to the latest Sidekiq version but I'm not sure what I need to upgrade or update in my code/libraries. Any ideas?
0
votes
2
answers
263
views
Association gives deprecation warning about merging conditions on the same column no longer maintain both conditions
Migrated from Rails 6.0 to 6.1 and stumbled upon this deprecation when is called 'type_documents relation', :
ActionView::Template::Error (DEPRECATION WARNING: Merging ("documents"."...
0
votes
1
answer
253
views
Rails 6 form_with remote UJS, bind extra handler to select or submit
In my Rails app, I have a form for voting on various "post" titles. The form has one select element, and submits remotely to a VotesController using rails-ujs. I want to handle response the ...
1
vote
1
answer
215
views
ActiveRecord::ConnectionTimeoutError for background jobs with read replica
We recently implemented a read-replica in our Rails 6 application. We are only using it for specific transactions by wrapping them in a block:
ActiveRecord::Base.connected_to(role: :reading) do
# ...
0
votes
1
answer
98
views
Add new feature announce box (Modal) when loading the page on Ruby on rails
I'm a beginner to ROR. Currently using Ruby 6.1 . I'm trying to add new feature announce box to inform users about recent changes of the app. This is a web app. This should popup in when accessing the ...
15
votes
2
answers
8k
views
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
...
1
vote
0
answers
319
views
Migrate rails application using ar-octopus gem to Rails v6.x.x
Did Rails Dev, migration rails app using ar-octopus to rails version 6/7.
As I see there are no updates regarding the rails v6 in ar-actopus gem, did any tried to upgrade on own.
Thanks in Advance.
0
votes
0
answers
608
views
Rails 7 - selecting database with multi-database when calling ActiveRecord::Base.connection.execute
The new multi-database feature is great, however it is unclear to me how you can still execute raw mysql calling ActiveRecord::Base.connection.execute and have it select a specific database in the ...
2
votes
1
answer
1k
views
Zeitwerk + Rails 6.1 with model and namespaced subclasses, "earlier autoload discarded"
After researching this on SO and a very similar issue in Rails' GitHub issues, I'm still unclear what's wrong. My namespaced model subclasses are not eager-loaded, but I believe they are declared ...