Questions tagged [ruby-2.6]

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

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

44 questions
2
votes
1 answer

Ruby: How to eager load class contents before a module gets loaded in its parent class

I've got a few classes with a constant SCHEMA class Consumable::ProbeDesign < Consumable SCHEMA = { "type": "object", "properties": { }, "required": [] } end class DataModule::WaterDeprivationLog < DataModule SCHEMA = { …
Andrew
  • 942
  • 10
  • 26
2
votes
3 answers

Failed gem install: gem require ruby-2.6.1 but the currently ruby-2.6.1

Show messages errors: Required ruby-2.6.1 is not installed. To install do: 'rvm install "ruby-2.6.1"' ruby -v ruby 2.6.1p33 (2019-01-30 revision 66950) [x64-mingw32] rails -v Rails 5.2.2
Hokly Leng
  • 43
  • 1
  • 7
2
votes
1 answer

Docker image for ruby 2.6.1

It seems like the latest 2.6.1 version is not yet available at Docker Hub I defined it as follows in Dockerfile and it fails to pull it: FROM ruby:2.6.1 The official repo for Docker ruby image was updated just 2 days ago to 2.6.1. Any ideas ? Thank…
belgoros
  • 3,590
  • 7
  • 38
  • 76
1
vote
1 answer

Different behavior of `public_send` in Ruby 2.6 / 2.7

class A def a 1 end end a = A.new x = {} a.a(**x) # => 1 in both Ruby 2.6 and 2.7 a.public_send(:a, **x) # => 1 in Ruby 2.7 In Ruby 2.6, however: ArgumentError: wrong number of arguments (given 1, expected 0) Is this a bug in pre-2.7…
phil pirozhkov
  • 4,740
  • 2
  • 33
  • 40
1
vote
0 answers

jquery doesn't fire but returns text

I have an application rendered with a layout. One menu item is created with %li.nav-item = link_to bands_path, :class => "nav-link", remote: true do %span Bands The routes is resources…
Paolo Di Pietro
  • 517
  • 3
  • 17
1
vote
1 answer

Rails server exits automatically. This is what i see below:

Macs-MBP:myapp mac$ rails server => Booting Puma => Rails 6.0.1 application starting in development => Run `rails server --help` for more startup options Exiting Traceback (most recent call last): 80: from bin/rails:3:in `
' 79: from…
Hapi
  • 31
  • 5
1
vote
0 answers

Weird behavior difference between @var and attr_accessor in Ruby

I found weird behavior difference between an instance var (@var) and an attr_accessor. I believe when specified in attr_accessor, var=some_value should behave the same as @var=some_value. However, the below code snippet (LinkedList implementation in…
trainsushi
  • 133
  • 1
  • 3
1
vote
1 answer

How to upgrade Ruby 2.3.1 to 2.6.5 in Rails application with verifying the compatibility and deprecation checks using a tool or gem

Current Ruby Version is 2.3.1 and want to upgrade it to 2.6.5; Rails version 5.2.2, later some time want to upgrade it to 6.0.0 My first question is would it be good approach to directly upgrade to 2.6.5 or to upgrade by major versions ?? And second…
Arun
  • 11
  • 4
1
vote
1 answer

Hide the output of a command using Ruby 2.6

I am not sure this is a bug or a new feature of Ruby 2.6, but since performing the upgrade 2.3 --> 2.6, my IRB terminal does not behave as usual and cannot hide outputs anymore. Previously when I typed a semicolon, it would wait until receiving the…
Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164
1
vote
2 answers

Is there any way to specify how to compare of array of objects for .difference function in Ruby 2.6.0?

I am trying to compare an array of externally defined Objects. I was hoping I would be able to do a simple .difference, a function that was introduced in Ruby 2.6.0 but after looking at it:…
nanci.drew
  • 125
  • 1
  • 8
1
vote
0 answers

API calls are failing in Rails 5.2.2 & Ruby 2.6.2

I have upgraded my rails application to ruby 2.6.2 and rails 5.2.2. After upgrade API calls are failing with the following error message. Kindly help me to solve this issue. 2.6.2 :004 > RestClient.get("https://www.google.co.in") Traceback (most…
Can Can
  • 3,644
  • 5
  • 32
  • 56
0
votes
1 answer

Heroku pipeline release deducts error while on deployment

I have been trying to deploy rails4 and ruby 2.6.5 version in to Heroku pipeline. It gives following error during release step. Error Trace Running release command... bundler: failed to load command: rake…
Kannan S
  • 2,459
  • 1
  • 17
  • 17
0
votes
1 answer

How to point Rails in `development` to a differently named DB config in `database.yml`?

The goal is to configure all 3 default environments ('development', 'test', 'production') from the ENV hash. How can I tell Rails to establish the following mapping, where main is defined in config/database.yml below? 'development' -> main 'test' ->…
0
votes
1 answer

Ruby returns early from loop

I have a class, with one method: class ScreenerProbe def initialize @body = {} end def import_simple_matrix(questions, answers) @body['aliases'] = answers.map { |pair| return { val: pair["text"], text: pair["value"] } …
JUlinder
  • 995
  • 1
  • 8
  • 19
0
votes
1 answer

Overriding const_missing returns `NameError uninitialized constant` in non-dev environments

I have the following code in my rails app # app/models/test_module/text_class.rb module TestModule class TestClass end end # app/models/test_module.rb module TestModule def self.const_missing(name) …
tob88
  • 2,151
  • 8
  • 30
  • 33