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
2
votes
0 answers

How do I fix Error loading RubyGems plugin?

My original purpose was to start a new rails project by getting the most updated versions of rails and ruby. In doing so I broke something. My question seems to be often repeated in one form or another. I've spent much of the morning going over the…
Lenocam
  • 331
  • 2
  • 17
2
votes
1 answer

ERROR: While executing gem ... (Gem::FilePermissionError)

I'm trying to setup rbenv to use with fastlane. I follow the instructions here. I've installed rbenv rbenv install 2.3.1 Then updated it so the version points to: rbenv local 2.3.1 => 2.3.1 (set by /Users/pepe/Development/test-ios/.ruby-version) I…
peuhse
  • 1,688
  • 2
  • 20
  • 32
2
votes
1 answer

How to load fixtures in a specific order in Rails 5

I have two interdependent models, account and user. An account is always created by a user, whose id is thus stored in the account's creator_id attribute, and a user necessarily belongs to an account (but there's no limit on the number of users…
2
votes
1 answer

listing subclasses in Ruby 2.3.1

I have the following method to gather a list of subclasses. For various reasons I can't use ActiveSupport DescendantsTracker. def self.descendants unless @subclasses @subclasses = [] ObjectSpace.each_object(Class) do |subclass| if…
2
votes
0 answers

Saving and loading very large numbers

I have run into a storage problem. I have a very large "magic" number that I'd like to use frequently (cuts computation time by a staggering 98%). The catch is that the number takes almost 40h to compute, so if I could save it and reload it in a…
CookieNinja
  • 211
  • 1
  • 4
2
votes
0 answers

postgres gem failing to install mac osx sierra

This one i cant figure out im running osx sierra but was fine for a while and then all of a sudden when i tried to do a bundle update ive tried everything i have google and completly reinstalled homebrew and postgres but nothing, any help is very…
Ray
  • 123
  • 11
2
votes
2 answers

divide function for set in Ruby 2.3.1

The below is from Ruby 2.3.1 documentation for dividing a set into a set of its subsets based on certain criteria applied to each pair of elements in the original set. Basically, if two numbers in the set are within 1 unit of each other, they fall…
user17144
  • 428
  • 3
  • 18
2
votes
1 answer

OpenStruct issue with Ruby 2.3.1

In Ruby 2.1.5 and 2.2.4, creating a new Collector returns the correct result. require 'ostruct' module ResourceResponses class Collector < OpenStruct def initialize super @table = Hash.new {|h,k| h[k] = Response.new } end …
Brit200313
  • 728
  • 5
  • 20
2
votes
1 answer

Ruby array delete if and get deleted object

So I have this situation where I need to delete something from an array conditionally, meaning that I want to go through the items in the array and do a test and delete the one that passes the test, and then I want to get that deleted item back. If…
jaydel
  • 14,389
  • 14
  • 62
  • 98
2
votes
1 answer

Ruby 2.3.0: assigning to nil as Hash does not raise NoMethodError

I've just noticed a very puzzling change in behaviour between Ruby 2.2.4 and Ruby 2.3.0: trying to use [] on nil in an assignment does not raise a NoMethodError anymore. Ruby 2.2.4: box:~ jfoeh$ irb 2.2.4 :001 > a = nil => nil 2.2.4 :002 > a[:b] =…
janfoeh
  • 10,243
  • 2
  • 31
  • 56
2
votes
0 answers

Memory Leak in rails app with ruby 2.3.0 and Puma 2.15.3

For some time I've been having a memory leak in my application. The current setup runs with Ruby 2.3.0, Rails 4.2 and Puma Webserver puma 2.15.3 It is recommended by Heroku to use Puma, however a lot of debugging has lead me to believe it's actual…
Thomas C
  • 714
  • 1
  • 6
  • 15
2
votes
0 answers

Errno::EMFILE: Too many open files when upgrading to ruby 2.3

I just upgrade to ruby 2.3 in order to take benefits of the frozen_string_literal option but it produce me the error Errno::EMFILE: Too many open files in production. When I downgrade to ruby 2.2.3, no more errors. Here is one of the ruby 2.3 error…
Naremy
  • 491
  • 8
  • 22
1
vote
2 answers

error occurred while installing semacode (0.7.5) gem

Issue while installing semacode gem from gemfile. is there a way to resolve this? i am running bundle install. Is this a issue with my machine or a gem issue? This issue did happen for the first time on my machine when i tried to run the application…
s.matty
  • 125
  • 1
  • 11
1
vote
1 answer

Ruby help. How should I recurse through this data to be display it?

So I have data that I am trying to learn from that looks similar to what I posted lower down. For simplicity of explaining my needs I will say that I am trying to pull the id from each item in the array and then each id of the values of that object…
Student
  • 29
  • 4
1
vote
0 answers

Use Rails 4 Syntax For Associations in Rails 3.2

Is there any way I can support the Rails 4 syntax for defining associations in Rails 3.2? I currently have the following Rails 4 syntax: has_many :clients, -> { where("client_type = 'temp'").order("name DESC") }, through: :user I want my Rails 3.2…
Artem Kalinchuk
  • 6,502
  • 7
  • 43
  • 57