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

Why is the paper_trail gem trying to do an empty insert in Rails 4.2/Ruby 2.2.0?

I have an app that was recently upgraded to Rails 4.2.0 and Ruby 2.2.0. Since the upgrade I am seeing the following exception in the production environment: Mysql2::Error: Field 'item_type' doesn't have a default value: INSERT INTO versions VALUES…
1
vote
1 answer

Pundit gem error class overriding my custom error class in ruby

my application has custom error classes defined lib/error/* example #lib/error/custom_error.rb module Error class CustomError < StandardError attr_accessor :error, :status, :message def initialize error, status, message …
Nijeesh Joshy
  • 1,426
  • 13
  • 24
1
vote
2 answers

Ruby 2.2.3 in 2020

Ruby 2.2.3 has been dead for a while and yet I've been asked to look at a legacy project in order to update and fix it. I can't get 2.2.3 to install in order to get a local env up and running on either MacOS or Ubuntu. The error seems to be down to…
Phil-6
  • 552
  • 6
  • 16
1
vote
0 answers

Ruby on Rails - Small activerecord and view rendering time yet big response time

I have a Ruby on Rails application that is working fine for most of the API requests but for some API requests it just hangs. ActiveRecord queries are made in small time and also view is rendered in small time as well but yet response time is very…
Zahid
  • 1,822
  • 4
  • 18
  • 26
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

Why base class method is being called inside inherited?

In self.inherited method of base class, subclass is passed, calling subclass's name method instead calls base class method. Though same thing works If same method is called on same class elsewhere class A def self.name "a" end def…
Anurag Uniyal
  • 85,954
  • 40
  • 175
  • 219
1
vote
0 answers

Ruby error: undefined local variable or method `c'

I am working on a ruby application but getting a strange error that I believe might be caused by activerecord/activemodel. The error is as follows: Error on PaymentTransaction::Normal: undefined local variable or method `c' for…
dagnyc
  • 29
  • 4
1
vote
2 answers

Error installing mysql2: ERROR: Failed to build gem native extension

I'm using (Mac Os) gem 'rails', '~> 4.2.0' # rails edge ruby '2.2.0' gem 'mysql2' After running bundle i got this error An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue. Make sure that gem install…
Anand
  • 6,457
  • 3
  • 12
  • 26
1
vote
0 answers

Memory increases when upgrade ruby from 1.9.3 to 2.2.10

I was using Ruby 1.9.3 + Rails 3.2.22 in heroku, recently i have upgraded ruby 1.9.3 to 2.2.10 then i could see that memory is growing fast and getting memory quota, we were using performance L dynos and WEB_CONCURRENCY as 80. Will it help anything…
Developer
  • 561
  • 7
  • 29
1
vote
1 answer

Shoes Rb Hostname not known: sub.localhost:3000

I am using the shoes's GUI builder and I get the below error when I make a simple HTTP request to my local Rails server So when I make the request res = Net::HTTP.get(URI.parse("http://sub.localhost:3000")) I get the error: Hostname not known:…
teddybear
  • 546
  • 2
  • 6
  • 14
1
vote
0 answers

Best regex to match an opening then closing HTML tags, no matter what content

I'm parsing an HTML source as a string, and I want to remove all