Questions tagged [ruby-2.3]

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

Ruby 2.3.0 was released on on 25 Dec 2015. It is the first stable release of the Ruby 2.3 series.

It introduces some new features (like the safe navigation operator and frozen string literals) and various performance improvements. A description of new features in Ruby 2.3 is at https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released/.

This tag is intended for questions specific to version 2.3 of Ruby.

164 questions
1
vote
2 answers

selection of line based on the pattern using ruby 2.2

I have file called regional.txt and it has data as below : shell.SetMyFile "Ranger" shell.SetMyErrorFile "Discovery" shell.SetMyFileEnabled 1 shell.SetMyLogFileEnabled 1 Now I am reading this file using ruby and trying to filter the text from…
cyborg
  • 870
  • 1
  • 15
  • 34
1
vote
1 answer

Check all products belong to a category are enabled or disabled?

I have products belongs to a category and each product has status enabled and disabled enum status: [:disabled, :enabled]. On Category page I want to check weather all products in category all enabled or not. I tried below code which return array…
O'hare
  • 13
  • 5
1
vote
0 answers

Ruby on Rails writing ActiveJob sub-class logs to a desired file

Ruby : 2.3.2 Rails: 5.0.0.1 I have following classes class JobA < ApplicationJob def perform(args) Rails.logger.debug "JobA log" if condition_1 JobB.perform_later(args) else JobC.perform_later(args) end …
Jignesh Gohel
  • 6,236
  • 6
  • 53
  • 89
1
vote
1 answer

Time.current.tap{|t| t.change hour: 10 } is not working in Rails 4.2

I tried [107] pry(main)> t=Time.current => Tue, 02 Jul 2019 19:19:05 KST +09:00 [108] pry(main)> t.tap{|tt| tt.change hour: 10 } => Tue, 02 Jul 2019 19:19:05 KST +09:00 [109] pry(main)> t => Tue, 02 Jul 2019 19:19:05 KST +09:00 hour is not…
chobo
  • 4,830
  • 5
  • 23
  • 36
1
vote
1 answer

stack level too deep (SystemStackError) while deploy heroku

I'm having a stack level too deep error using Ruby 2.3.1 with Rails 4.2.6. How should I fix this problem? When I run below command, error showed up. heroku run rails db:migrate Here is the error. Tasks: TOP => db:migrate => environment (See full…
Ryoma
  • 31
  • 1
  • 1
  • 8
1
vote
1 answer

Not able to make relationship correctly the rails way or a polymorphic relation ship?

I am using rails 5 and Ruby 2.3 I have a model name User created using the devise which can create jobs so the migration used for this is: rails g model job user:references cader_id:integer These jobs can be completed by the other user's with role…
vidur punj
  • 5,019
  • 4
  • 46
  • 65
1
vote
2 answers

Which class does a method defined inside a block belong to?

Here's a class class Foo def test_method(&c) puts "inside test method" c.call end end Now, if I define a method inside the block f = Foo.new f.test_method do def m1 puts "inside the method m1 defined inside the block" end …
dhaliman
  • 1,542
  • 1
  • 12
  • 23
1
vote
1 answer

not able to install ruby-2.3.4

I am trying to install ruby-2.3.4 in my mac but without luck. Below is system's spec: macOS Sierra Version 10.12.6 I have ruby 2.0 by default and I managed to install ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16] Below is the error…
Chuchoo
  • 823
  • 2
  • 17
  • 36
1
vote
0 answers

source sequence is illegal/malformed utf-8 when including GON gem?

I am working with Ruby 2.3.3, Rails 5.1.5 and using the RubyMine (JetBrains) IDE and I am working the gon gem to send data to javascript. In my application.html.erb I am setting the <%= include_gon %> in the head (as specified by the gon…
1
vote
1 answer

RVM fails to install Ruby 2.3.x

RVM fails, and hangs, when trying to install Ruby 2.3.x (2.3.1 in my case) on Manjaro 4.11.12, but this issue has been also reported on other operating systems such as openSUSE. The error thrown is Error in../../miniruby': corrupted double-linked…
Paul Andrei
  • 108
  • 7
1
vote
1 answer

shoryuken error to `validate_queues': The specified queue(s)

I am using rails "Shoryuken" gem but I am getting errors for validation on queues on my development environment when I started rails server below is the error:- gems/shoryuken-2.0.11/lib/shoryuken/environment_loader.rb:172:in `validate_queues': The…
1
vote
1 answer

Rails: Query nil has_one association

I have two models: Patient and CodeStatus. CodeStatus belongs_to Patient, and Patient has_one CodeStatus I am trying to query all patients where patient.code_status is nil. I was surprised to find that Patient.where(code_status: nil) does not work…
Greg
  • 298
  • 1
  • 3
  • 16
1
vote
1 answer

Ruby 2.3 write UTF-16LE gzip file

I have this code, running with Ruby 2.3.1: str = "麦克风访问被拒绝" puts str.encoding #=> "UTF-8" conv = Encoding::Converter.new("UTF-8", "UTF-16LE") str = conv.convert(str) puts str.encoding #=> "UTF-16LE" Zlib::GzipWriter.open("test.gz", encoding:…
Eduard
  • 3,536
  • 1
  • 20
  • 27
1
vote
2 answers

why does "aabbcc"[/ab*/] only return "a"?

If the quantifier * represents, 'zero or more times,' it seems like "aabbcc"[/ab*/] should return "abb" but it returns only "a".
maml
  • 594
  • 3
  • 11
1
vote
0 answers

Benchmarking crono scheduler in enterprise level

I have been using Crono gem in some personal applications. Now I was planning to use Crono in my current organization, to schedule jobs at enterprise level. I wanted to know if any one have already run some benchmarking tests for the…
Chezhian
  • 773
  • 9
  • 15