Questions tagged [ruby-2.2]

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

For issues relating to development in Ruby, version 2.2. It was released on December 2014. You can check the official docs here.

If your question applies to Ruby in general, use the tag .

119 questions
5
votes
1 answer

Ruby str.match(regex) returns MatchData containing only first matched item

Using Ruby 2.2 I have strings like following: Weekly on Tuesday and Friday Weekly on Monday, Wednesday and Saturday Monthly every 2 weeks on Monday To extract the days of week from above shown strings I have written following…
Jignesh Gohel
  • 6,236
  • 6
  • 53
  • 89
5
votes
4 answers

rails server cannot start; getaddrinfo: nodename nor servname provided, or not known (SocketError)

I have not found a solution to the problem, however someone did already ask about the same problem a few days ago - (Rails Server Keeps Exiting (SocketError)) After I start a rails server the system returns some error I cannot understand. To…
Alex
  • 339
  • 1
  • 2
  • 9
4
votes
0 answers

How to harden rails+webrick+https with insecure ciphers removed on Ruby 2.2

Updated: At first, my test code didn't adequately show ruby 2.4 sees the :SSLCiphers option whereas ruby 2.2 does not. I have edited the example code below to make that clear. Updated: Since my question failed to elicit any help from the community,…
4
votes
1 answer

How to list all methods of a class (not Extended and Included methods)

Using Ruby 2.2.1, How to list all methods (preferrably Array of String names) of a class that is only defined in that class / file where include and extend methods are filtered out. I want to distinguish class and instance methods as…
Jay-Ar Polidario
  • 6,463
  • 14
  • 28
4
votes
2 answers

How to run existing test code on Ruby 2.2

The following code (which has no Gemfile) works on Ruby 2.1.1, but not Ruby 2.2.0 require "bundler/setup" gem "minitest", "4.7.5" require "test/unit" class TestFoo < Test::Unit::TestCase def test_foo assert true, "Useless mesage" skip…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
3
votes
2 answers

RVM issue with macOS Sierra while installing Ruby 2.2.6

I'm running OSX (10.12.3) and I have Ruby installed (2.2.2) which is working fine. I'm trying to upgrade to 2.2.6 using RVM. Install seems to go fine. - rvm install 2.2.6 Searching for binary rubies, this might take some time. No binary rubies…
mpartan
  • 1,296
  • 1
  • 14
  • 30
3
votes
0 answers

Merge PDF files containing Optional Content - Ruby 2.2.4 - Rails 4

In a Rails 4 project I have been tasked with merging an “about” page to the end of PDF documents that have been uploaded via Paperclip. The issue is that some of the uploaded pdfs contain optional content. I started out using combine_pdf but it does…
NickTerrafranca
  • 109
  • 1
  • 8
3
votes
1 answer

Rails and RSpec: Testing controllers with the same name in different namespace (module)

I have rails 4.1.16 API application that is tested using RSpec 3.4.0, and I experience problems with testing classes called the same name in a different module. The structure is: app/controllers/bar/notifications_controller.rb class…
Anita
  • 53
  • 8
3
votes
0 answers

Strange bug with define_singleton_method and keyword arguments

I stumbled upon what I believe to be a weird bug in Ruby (I'm using 2.2.2). When I define a method like so: def test(value, **kw) puts value puts kw end I get the expected output: > test(1) 1 {} => nil > test(1, channel:…
Kevin Choubacha
  • 368
  • 3
  • 10
3
votes
2 answers

Why are parenthesis sometimes required in Ruby?

I recently ran into an oddity while looking at some Ruby code from the Rails docs. Ruby lets you pass arguments like these examples: redirect_to post_url(@post), alert: "Watch it, mister!" redirect_to({ action: 'atom' }, alert: "Something serious…
Tom Prats
  • 7,364
  • 9
  • 47
  • 77
3
votes
1 answer

Sidekiq 3.4.2 and Rails 4.2.0 having error with 'undefined method perform_at'

I have jobs class for ex class TempJob < ActiveJob::Base queue_as :default # To Do Design Queue around_perform do |job, block| puts "Before Perform' block.call puts "After Perform" end def perform(*args) …
KrunaL
  • 181
  • 2
  • 10
3
votes
1 answer

Ruby 2.2.2 ri documentation

I'm starting to learn Ruby, so I installed Ruby 2.2.2 via Macports. I understand that the ri documentation does not install by default, so I want to generate it. I read a few questions/answers on SO and came up with this: gem install…
Paul T.
  • 326
  • 1
  • 2
  • 11
3
votes
1 answer

is The Ruby Programming Language book still valid in ruby 2.2.2?

I am learning ruby. I was wondering if the The Ruby Programming Language book is still valid in ruby 2.2.2 even though the book is written for ruby 1.8 and 1.9?
Ludvig Sørensen
  • 397
  • 4
  • 13
3
votes
1 answer

No such file or directory @ rb_sysopen - libreconv

I am new to 'libreconv' gem, I am using Ruby 2.2.0 and Rails 4.2.0 version While I am converting Ms Word document to PDF, I get following error: 2.2.0 > Libreconv.convert('sample1.doc', '/Users/rp/test_document.pdf') Errno::ENOENT: No such file or…
fidato
  • 719
  • 5
  • 22
2
votes
1 answer

Turbolinks are not working with bootstrap select2 in Rails 4.2.4 Ruby 2.2.4

When I first time load my page, select2 will work properly... But if I go to other links, we wouldn't be able to see select2 unless we reload the page. Here's my code: Gemfile: gem 'turbolinks', '~> 5.0.0' gem "select2-rails" application.js: //=…