Questions tagged [ruby-3]

For issues relating to development in Ruby, version 3. If your question applies to Ruby in general, use the tag [ruby].

Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. Ruby 3.0 was released Dec 25, 2020.

For information on Ruby in general, visit . And API documentation for Ruby 3.0.0.

The official release 3.0 announcement summarizes the changes as:

  • Performance
    • MJIT
  • Concurrency
    • Ractor
    • Fiber Scheduler
  • Typing (Static Analysis)
    • RBS
    • TypeProf
82 questions
1
vote
0 answers

Rails: Using Strong Params as keyword parameters

Let's say I have a User Model with a class method create_with_info. Currently if I want to password the params into the method using keyword parameters, It will be something like this. # user_controller.rb def create_with_info …
jameslee
  • 23
  • 3
1
vote
0 answers

Rails monkey patching didnt work well with TimeWithZone object

I have this Time class extensions inside lib/core_extensions/time/formatter.rb module CoreExtensions module Time module Formatter def to_formatted_utc puts({a: self.utc, b: utc}) utc.strftime("%H:%M") end def…
1
vote
1 answer

How can "allows nil" be added to a type declaration in Ruby?

I'm familiar with type annotations in Ruby. However, no where have found a mention about nilable types. That is, something similar to this: class Merchant attr_reader token: String # never nil attr_reader name: String # how to signal it that it…
michika
  • 11
  • 2
1
vote
2 answers

App (rails 6.1.1) can't boot after upgrading to Ruby 3.0

Here is the Gemfile: source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '3.0.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.1.0' # Use mysql as the database for…
den
  • 51
  • 2
  • 8
1
vote
1 answer

Creating new object in Rails Admin not working after updates

I'm rewriting a project that I had built with Ruby 2.7 and Rails 6.0 with Ruby 3 and Rails 6.1. I'm using the rails admin gem along with devise and cancancan. In my old project I've got no issues creating a simple EventCategory object. When I try…
moyejg
  • 125
  • 8
0
votes
1 answer

rails credentials inside of docker is no longer opening

My rails environment runs from a Docker. Previously using a Docker ruby:2.7.5 (when I created th project credential, but I think it doesn't matter), and currently using ruby:3.2.2. Suddenly, when I try to edit the credentials (from host or from the…
0
votes
0 answers

Process jobs with Sidekiq Scheduler

I'm not sure what I'm missing with my Sidekiq Scheduler setup. I can process jobs manually, but the scheduled jobs aren't running. Pressing Enqueue Now from the Web ui runs the job correctly. Starting sidekiq with bundle exec sidekiq says Schedules…
teddybear
  • 546
  • 2
  • 6
  • 14
0
votes
1 answer

Ruby IPAddr class accepting wrong IPv6 address string

We are middle of upgrading ruby versions v2.7.3 -> v3.1.3 One of our test cases are failing related to valid ipv6 address string, check the following # ruby 2.7.3 IPAddr.new('fe80::85e:7530:69ec:9074%en0').ipv6? => IPAddr::InvalidAddressError…
Md. Farhan Memon
  • 6,055
  • 2
  • 11
  • 36
0
votes
1 answer

Unable to Install Ruby 3.0.2 on Ubuntu 22.10

I've tried using both Ruby Version Manager (RVM) and RBENV to install 3.0.2 and both times I get some kind of Make error, but can't make heads or tails of the log files. Here is the console log for installing with RVM ~$ rvm install 3.0.2 ruby-3.0.2…
0
votes
0 answers

Uninitialized constant for autoload_paths when migrate to Rails 6

I have project on ruby 2.6.2 and rails 5.2.3. I successfully migrate to ruby 3.1.3. And now try migrate to Rails 6.1.7.3. But when I try to run rails c, I get next exception: uninitialized constant DateUtils (NameError) DateUtils is a module in…
0
votes
2 answers

Binding.pry not showing the stopping point in console after ruby 3 upgrade

I am new to ruby, we have a ROR microservice(rails version 6.1) , recently i updated the ruby version on the service from 2.7 to 3.0 , after this since there were failures and i wanted to debug it, so i added binding.pry , when the binding.pry is…
0
votes
2 answers

boolean field not updating in Rails

I am building a basic crud app; with my controller method for updating a task as follows :- def update @task = Task.find(params[:id]) respond_to do |format| if @task.update(task_params) format.html { redirect_to…
0
votes
2 answers

Is it possible to pattern match on a hash value to get the hash key in Ruby 3?

This is a question about pattern matching in Ruby 3. I have a hash: h = { x: [1, 2, 3], y: [11, 12, 13], z: [100, 101], } Given an integer (for example, 13), I'd like find the hash key whose hash value contains the integer (:y in the…
Zack Xu
  • 11,505
  • 9
  • 70
  • 78
0
votes
0 answers

sidekiq - runaway FIFO pipes created with large job

We are using Sidekiq to process a number of backend jobs. One in particular is used very heavily. All I can really say about it is that it sends emails. It doesn't do the email creation (that's a separate job), it just sends them. We spin up a new…
0
votes
0 answers

Multiple files with the same output path cannot be linked ("actiontext.css")

using: ruby 3.1.2p20 and Rails 7.0.2.3 after updating the application from rails 6 to 7 its giving the following error after starting the application: ActionView::Template::Error (Multiple files with the same output path cannot be linked…
vidur punj
  • 5,019
  • 4
  • 46
  • 65