Questions tagged [ruby-on-rails-7]
For Ruby on Rails 7 questions: Ruby on Rails 7 is a web app framework in Ruby. Use tags like [ruby-on-rails], [ruby], [rails-7], [activerecord], [actionview], [actioncontroller], [routing], [authentication], [authorization], [database], [testing], [deployment], [gems], [api], etc. Provide specific details and errors.
ruby-on-rails-7
1,008
questions
81
votes
3
answers
29k
views
Rails 7 Ruby 3.1 LoadError: cannot load such file -- net/smtp
I upgraded to Rails 7 and Ruby 3.1. While trying to run tests with rspec I got the error below. How can I fix it?
An error occurred while loading rails_helper.
Failure/Error: require File.expand_path('...
46
votes
4
answers
34k
views
How to add custom JS file to new rails 7 project
I created new rails 7 project rails new my_project and have a problem to include my custom JS file to be processed by rails.
my "javascript/application.js"
import "@hotwired/turbo-rails&...
40
votes
2
answers
21k
views
Could not open library 'vips.42'; Could not open library 'libvips.42.dylib'
When upgrading from rails 6 to rails 7, and running some ActiveStorage methods locally, I see:
Could not open library 'vips.42': dlopen(vips.42, 0x0005): tried: 'vips.42' (no such file), '/usr/local/...
36
votes
4
answers
10k
views
Rails `require': cannot load such file -- matrix
after updating to ruby 3.1.2 and Rails 7.0.2.3
getting following error while starting rails application:
`require': cannot load such file -- matrix (LoadError)
what could be the possible solution, ...
27
votes
6
answers
33k
views
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 ...
25
votes
3
answers
20k
views
Error: Form responses must redirect to another location
I need to render an html code I receive from an API.
In Rails 6 : I was doing this in my controller, and it was working fine. I called the webservice I received the response, and I was redirected to ...
23
votes
1
answer
11k
views
Rails 7 Dynamic Nested Forms with hotwire/turbo frames
I'm very new to Rails. I've started right from Rails 7 so there is still very little information regarding my problem.
Here is what I have:
app/models/cocktail.rb
class Cocktail < ApplicationRecord
...
20
votes
5
answers
24k
views
Rails 7.0 + esbuild: running app gives error: Command "build" not found
Newly generated Rails 7.0 with esbuild option errors out on startup.
rails new [project name] --javascript=esbuild --css=tailwind
On creating a new rails 7 project, I try to start the application ...
18
votes
4
answers
8k
views
Rails 7 - picking up assets automatically in dev doesn't work
For some unknown reason Rails 7 (development environment) doesn't pick up changes in application.js automatically when I hit F5 in the browser. The location application.js is default. I'm using pretty ...
18
votes
3
answers
7k
views
Idiomatic Sass processing in Rails 7
I'm confused about the idiomatic way to process Sass in Rails 7.
The README.md for the importmap-rails repo says:
This frees you from needing Webpack, Yarn, npm, or any other part of the JavaScript ...
17
votes
4
answers
23k
views
How to install jQuery and bootstrap in rails 7 app using esbuild (without webpacker)
I'm trying to create a rails app by installing bootstrap and jQuery.
First I tried to create using
rails new name--css bootstrap
But its not working. So I did it with it manually.
I tried also using ...
16
votes
3
answers
12k
views
Rails UJS not firing with Rails 7
I upgraded my Rails application to Rails 7. I know that Turbolinks and Rails UJS actually are replaced by the Hotwire combination of Stimulus and Turbo in Rails 7, but I wanted to know whether I can ...
16
votes
1
answer
6k
views
Rails 7 (7.0.2.3) Importmap jQuery is not defined in view
I've looked around for as much help as possible regarding installing jQuery in Rails 7 (7.0.2.3). I want to use it in script tags in my views, but I can't seem to get it exported to where it is ...
15
votes
9
answers
13k
views
Ruby On Rails 7 - Delete method not working
within my RoR project my delete method is not working. It's weird because it was working a day ago but now all it does it redirects me to the "friend" page. Another thing to note is that the ...
15
votes
5
answers
11k
views
How to call confirm prompt using button_to in Rails with Turbo
Previously in Rails when using the button_to tag, it was possible to use a confirmation dialog like this
<%= button_to 'Destroy', @post, method: :delete, data: { confirm: 'Are you sure?' } %>
...