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
75
votes
3 answers

Rails 6.1, Ruby 3.0.0: tests error as they cannot load rexml

I've created a new Rails 6.1 application from scratch with Ruby 3.0.0. I've run db:create and generated a single model with some string columns, followed by rails db:migrate. I ran rails test but got this require rexml…
user3574603
  • 3,364
  • 3
  • 24
  • 59
41
votes
5 answers

RVM, where is Ruby 3.0.0?

I want to download the latest Ruby release(version 3.0.0), using RVM but I am faced with the following error when running rvm install 3.0.0: Unknown ruby interpreter version (do not know how to handle): 3.0.0 I have also tried 3 & 3.0, but gives…
grizzthedj
  • 7,131
  • 16
  • 42
  • 62
33
votes
2 answers

cannot load such file -- webrick/httputils

I have a project I'm trying to use ruby 3 (previously running with 2.7.2), but couldn't accomplish it. After updated my gemfile with the ruby version and ran bundle, I'm receiving this error when trying to access rails…
rwehresmann
  • 1,108
  • 2
  • 11
  • 27
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
13
votes
3 answers

MacOs (M1 Arm64) unable to load Nokogiri - Using system default Ruby

I could use some help here. I'm setting up a new 2020 Macbook Pro M1. I've completed all the regular steps to install ruby/rails on a Mac, however I'm unable to complete rails new. Upon hitting the following part of the install I get this…
ethanmclark
  • 218
  • 1
  • 2
  • 12
11
votes
4 answers

how can I change the default syntax coloring in ruby 3.0's IRB

I'm very happy to be using the most recent ruby 3.0; as well as having access to the updated command-line interpreter which does syntax highlighting and coloring. However, the colors are a bit hard to see for me. How can I change them? The command…
Simon DeDeo
  • 111
  • 1
  • 3
7
votes
1 answer

ArgumentError (wrong number of arguments (given 2, expected 1)) after updating to Ruby 3.0

When I try to update our site to Ruby 3.0.0 I get this error: ArgumentError (wrong number of arguments (given 2, expected 1)) % rails console Loading development environment (Rails 6.1.0) irb(main):001:0> puts RUBY_VERSION 3.0.0 irb(main):002:0>…
vince
  • 2,374
  • 4
  • 23
  • 39
6
votes
4 answers

Ruby 3 IRB home end and ctrl-u not working

I've recently started using Ruby 3 more and it seems the home key (to take me to the beginning of the line) the end key (end of the line) and ctrl-u (clear the line) aren't working. I'm running Arch Linux with Ruby 3.1.1p18 and a zsh shell. The keys…
KNejad
  • 2,376
  • 2
  • 14
  • 26
6
votes
2 answers

`require': Cannot load such file -- rdoc (LoadError)

While trying to run the "irb", I ran into this error: :85:in `require': cannot load such file -- rdoc (LoadError) from from…
jack-p
  • 63
  • 1
  • 4
6
votes
1 answer

paypal-checkout-sdk breaks in ruby 3.0.1

Ruby 3.0.1 Rails 6.1.3.2 Executing a Paypal OrdersCreateRequest fails with this error NoMethodError (undefined method `escape' for URI:Module): The backtrace points to…
kev
  • 1,148
  • 2
  • 14
  • 29
6
votes
1 answer

ruby 3 array argument splat with keyword arguments

Before ruby 3 it was possible to do sth like this def test a, **o p a, o end t = [:ok, **{ok: 2}] test *t it would properly assign :ok to a and {ok: 2} to o invoking in ruby 3 you will get ArgumentError (wrong number of arguments (given 2,…
mingle
  • 1,567
  • 1
  • 16
  • 19
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:…
5
votes
1 answer

undefined method `escape' for URI:Module in ruby 3

After updating my Rails application from Rails 6.0.1 to Rails 7.0.2.3 I am getting issue with the gem "paperclip", '~> 6.1.0' while using it in application is gives error: ActionView::Template::Error (undefined method `escape' for URI:Module Did you…
vidur punj
  • 5,019
  • 4
  • 46
  • 65
5
votes
1 answer

What's the replacement for acts_as_commentable in Rails 6, Ruby 3.0.2?

I upgraded our app to Rails 6.1.4.4 and Ruby 3.0.2. I have this old gem gem 'acts_as_commentable' Locked at version 4.0.2. The gem does not appear to be supported anymore, which is a shame because when I start up my app or console, I now get this…
Dave
  • 15,639
  • 133
  • 442
  • 830
5
votes
1 answer

How to configure Steep to find RBS files for a gem outside the stdlib?

Cannot find type `Sinatra::Base` ruby file class StaticApp < Sinatra::Base end rbs file class StaticApp < Sinatra::Base end run bundle exec steep check --log-level=fatal result [error] Cannot find type `Sinatra::Base` Diagnostic ID:…
gayavat
  • 18,910
  • 11
  • 45
  • 55
1
2 3 4 5 6