Questions tagged [ruby-2.7]

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

For issues relating to development in Ruby, version 2.7. If your question applies to Ruby in general, use the tag .

53 questions
66
votes
3 answers

How to fix Rails's warning messages with Ruby 2.7.0

Did anyone resolve this issue with Ruby 2.7.0? I used rbenv and installed Ruby v2.7.0 and then created a Rails project using Rails v6.0.2.1. Currently, by running one of rails s rails s -u puma rails s -u webrick the server is up and the site is…
Nezir
  • 6,727
  • 12
  • 54
  • 78
14
votes
2 answers

warning: URI.escape is obsolete when using paperclip in ruby 2.7.2

ruby - 2.7.2 rails - 6.0 paperclip - 6.1.0 I am getting following warning in my console, while using paperclip gem with ruby 2.7.2 /Users/***/.rvm/gems/ruby-2.7.2/gems/paperclip-6.1.0/lib/paperclip/url_generator.rb:68: warning:…
honey
  • 981
  • 6
  • 19
13
votes
4 answers

After updating ruby to 2.7.1 rspec tests throws error `Bundler::GemfileError for status code 4 but Bundler::GemfileError is already registered`

using Rails 5.2.4.3 Mac OSX Catalina 10.15.6 After updating ruby to 2.7.1 (via rvm) ran rspec spec and received error: Trying to register Bundler::GemfileError for status code 4 but Bundler::GemfileError is already registered #…
ea0723
  • 805
  • 11
  • 25
13
votes
3 answers

Destructure a Hash in block arguments in Ruby 2.7

This: [{a: 1, b: 2}, {a: 3, b: 4}].each do |a:, b:| p a end Raises the following warning in Ruby 2.7 warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call I understand that each is passing a…
Daniel
  • 4,051
  • 2
  • 28
  • 46
9
votes
1 answer

nil.to_s Produces a Frozen String?

I'm curious. Is it surprising that the snippet below yields a FrozenError? The magic comment # frozen_string_literal: true is not present. n = nil s = n.to_s s.force_encoding('UTF-8')
Larry North
  • 151
  • 2
9
votes
2 answers

Rails 4, Ruby 2.7.1 schema.rb shows "Could not dump table because of following FrozenError"

After upgrading to Ruby 2.7.1 my schema.rb is peppered with the following warnings for multiple tables: # Could not dump table "pages" because of following FrozenError # can't modify frozen String: "false" # Could not dump table "proxies" because…
padz
  • 91
  • 2
9
votes
2 answers

JSON Parser Error 783: unexpected token at for params

I am editing a resource - @article - and whenever I submit it I get the following error: JSON::ParserError in ArticlesController#update 783: unexpected token at '#' It has highlighted this line: if…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
5
votes
2 answers

Rails deployment on AWS server (EBS) | Issue with nokogiri-1.13.3-aarch64-linux wrt GLIBC_2.29

Have deployed my Rails application but now getting following error in /var/log/puma/puma.log file Early termination of worker ERROR: It looks like you're trying to use Nokogiri as a precompiled native gem on a system with glibc < 2.17: …
5
votes
1 answer

How does the method reference operator .: work?

This question is not very useful because the method reference operator was removed from Ruby 2.7.0 before release. This question is left up for historical reasons. Ruby 2.7.0-preview1 has introduced the method reference operator .: as an…
anothermh
  • 9,815
  • 3
  • 33
  • 52
4
votes
1 answer

Is this a bug in ruby Regexp? How to guard against "infinite loop" from regex match without using Timeout?

I have this regex: regex = /(Si.ges[a-zA-Z\W]*avec\W*fonction\W*m.moires)/i And when I use it on some, but not all, texts e.g. this one: text = "xation de 2 sièges-enfants sur la banquette AR),Pack \"Assistance\",Keyless Access avec alarme :…
Niels Kristian
  • 8,661
  • 11
  • 59
  • 117
4
votes
1 answer

ArgumentError when upgrading from Ruby 2.7 to 3.0 - related to separation of positional and keyword arguments?

I am trying to upgrade gems from ruby 2.7.0 to 3.0.0. I have tried to read and plan ahead for what roadblocks I'd hit, like the Separation of positional and keyword arguments. I have updated two gems smoothly, but I have started to upgrade a third…
3
votes
0 answers

How to configure datadog for Rails to avoid "The called method `initialize' is defined her" deprecation warning?

I’m using Ruby 2.7, Rail 6.2 and data dog (ddtrace) gem v 0.54.1. I have this config set up # config/initializers/datadog-tracer.rb Datadog.configure do |c| c.tracer enabled: APP_CONFIG[:datadog][Rails.env][:enabled] && !Rails.env.test? …
Dave
  • 15,639
  • 133
  • 442
  • 830
2
votes
1 answer

Rails couldn't infer whether you are using multiple databases from your database.yml in rails - 6 using nginx

While deploying code using capistrano gem - Rails couldn't infer whether you are using multiple databases from your database.yml and can't generate the tasks for the non-primary databases. If you'd like to use this feature, please simplify your…
Nehapeer
  • 89
  • 7
2
votes
1 answer

Which ChromeDriver & Headless Chrome versions exist that are compatible with ruby 2.7?

The issue I have a web scraper running in AWS lambda but in a few weeks AWS lambda will stop supporting Ruby 2.7. I built my scraper last year using this tutorial. I need to find a version of chrome driver & headless chrome that is compatible with…
2
votes
1 answer

BUILD FAILED (Ubuntu 20.04 using ruby-build 20210119)

I'm using rbenv and in Ec2 instance I'm trying to install a ruby different version but when I execute rbenv install 2.7.2 following errors occur. Downloading ruby-2.7.2.tar.bz2... ->…
Humayun Naseer
  • 440
  • 7
  • 18
1
2 3 4