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 is a popular web application framework written in the Ruby programming language. Here's a similar guide for asking questions about Ruby on Rails:

When asking a Ruby on Rails question, you should:

  1. Debug your code: Take the time to go through your code and identify any potential issues or errors. Look for error messages or unexpected behavior that can help you pinpoint the problem area.

  2. Isolate the problematic code: Extract the relevant code that is causing the issue and create a minimal, reproducible example. You can use online code editors like repl.it, CodePen, or GitHub Gists to share your code snippets.

  3. Provide context: Include relevant information about your environment, such as the version of Ruby on Rails you're using and any gems or libraries involved. If you're encountering errors, include the full error message along with the stack trace.

  4. Use appropriate tags: Tag your question with relevant tags to attract the right audience. For example, use [ruby-on-rails] for general Ruby on Rails questions, and specific tags like [ruby], [rails-routing], [activerecord], or [rails-view] for more specific topics.

  5. Mention browser-related issues (if applicable): If your question relates to browser rendering or JavaScript interactions within a Rails application, specify the browser(s) you're experiencing the problem on. Additionally, mention any error messages or unexpected behavior you encounter in the browser's developer console.

Remember to always do some research before asking a question. Check out official documentation like the Ruby on Rails Guides and other reputable sources like Stack Overflow or the Ruby on Rails subreddit to see if your question has already been answered.

By following these guidelines, you'll increase your chances of getting helpful answers and resolving your Ruby on Rails issues effectively.

801 questions
78
votes
2 answers

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('../config/environment', __dir__) LoadError: …
Sergey Alekseev
  • 11,910
  • 11
  • 38
  • 53
28
votes
4 answers

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, thanks in advance.
vidur punj
  • 5,019
  • 4
  • 46
  • 65
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…
26
votes
2 answers

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/lib/vips.42' (no such file), '/usr/lib/vips.42'…
stevec
  • 41,291
  • 27
  • 223
  • 311
26
votes
4 answers

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" import "controllers" import "chartkick" import…
pa3k
  • 501
  • 1
  • 4
  • 8
18
votes
4 answers

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 the code generated by the render. Fine ! class…
user15829831
  • 597
  • 1
  • 4
  • 8
15
votes
4 answers

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 using bin/dev which uses now uses foreman. However,…
notapatch
  • 6,569
  • 6
  • 41
  • 45
14
votes
1 answer

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 has_many :cocktail_ingredients, dependent:…
zdebyman
  • 550
  • 1
  • 4
  • 22
14
votes
3 answers

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 toolchain. All you need is the asset pipeline…
dumbledad
  • 16,305
  • 23
  • 120
  • 273
14
votes
4 answers

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 much default setup. When I run the server, it…
Roman Pushkin
  • 5,639
  • 3
  • 40
  • 58
13
votes
3 answers

tailwind.css not being generated in a Rails 7 project in Heroku

I have a Rails 7 project using TailwindCSS deployed to Heroku that is not building tailwind.css during rake asset:precompile and I don't know why. When I try to access the application, it crashes with this error: I, [2022-03-23T17:35:18.429029 #8] …
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
13
votes
4 answers

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 esbuild but at the case of printing in console it…
Ronats
  • 179
  • 1
  • 1
  • 10
13
votes
3 answers

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 still use UJS and if yes, why is it not…
sam
  • 191
  • 1
  • 8
13
votes
1 answer

Ruby on Rails 7 - Is there any way to implement js.erb files?

I've looked around for a couple days now for a way to implement js.erb files into my Ruby On Rails 7 application and could not find any resources on this topic. Are js.erb files completely depreciated in Rails 7? If so, is there any way to call in…
Kyowan Kim
  • 377
  • 3
  • 12
13
votes
9 answers

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 pop up dialog of "are you sure?" also does not show up…
Kyowan Kim
  • 377
  • 3
  • 12
1
2 3
53 54