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
0
votes
1 answer

Login with devise failed

I am using devise gem for authentication and current rails version (3.2.22), so my password have some special character like '@' , after upgrade to ruby 2.2.0 i couldn't login with that credentials but that allows me to login after removing that…
Developer
  • 561
  • 7
  • 29
0
votes
0 answers

Brakeman generating exceptions on an empty file

After upgrading recently to brakeman 3.3.5 I am getting a similar exception on two files. One is app/helpers/profile_mailer and the exception is golf_mentor/app/helpers/profile_helper.rb:1 :: parse error on value ":" (tCOLON) If I delete everything…
Obromios
  • 15,408
  • 15
  • 72
  • 127
0
votes
1 answer

Ruby string interpolation to add image to a link prefixes a slash to image src

I am using Ruby 2.3.1p112 and I am trying to use string interpolation to produce an image link. However, it incorrectly escapes the link src quotes, like this: src=\"http://localhost:3000/t\". The example is shown below:
brg
  • 3,915
  • 8
  • 37
  • 66
0
votes
1 answer

/dev/urandom to generate Random Number + ruby 2.3.0

Reading through the Ruby Doc 2.3.0 which states the strategy that Ruby code uses to generate a Random Number. openssl /dev/urandom Win32 But looking 2.3.0 Source I don't see any sign of /dev/urandom be used. Atleast 2.2.2 has /dev/urandom…
Viren
  • 5,812
  • 6
  • 45
  • 98
0
votes
2 answers

rails rescue_from ScriptError

According to the family tree of Exception. SyntaxError is child to ScriptError I wish to handle Syntax and/or ScriptError in my rails application. Exception NoMemoryError ScriptError LoadError NotImplementedError …
swapab
  • 2,402
  • 1
  • 27
  • 44
0
votes
1 answer

Comparing values of Ruby XMLRPC datetime returned from API to normal Ruby DateTime object

I have an XMLRPC datetime returned from a remote API, and I want to perform normal comparison operations to a standard Ruby datetime object, such as >, <, >=, etc. I've read that XMLRPC has some strange datetime restrictions (such as it doesn't…
0
votes
1 answer

ActiveModel::ForbiddenAttributesError only when creating a new record

I have upgraded my app rails version from 3.2.13 to 4.2.1 so When ever i am trying to create a new record i am getting ActiveModel::ForbiddenAttributesError I am using rails4.2.1. This my controller class CategoriesController <…
Anna88
  • 345
  • 3
  • 11
0
votes
0 answers

Wait for and trap only first level child processes

Ruby provides tools like Process.wait and Signal.trap to synchronize the forked processes. But how can you make sure that you will register only for first level child processes? E.g. if your main process starts process A and that one stars another…
Uko
  • 13,134
  • 6
  • 58
  • 106
0
votes
2 answers

Error upgrading to Ruby 2.2.4

I ran rvm install ruby-2.2.4 and got the following error: $ rvm reinstall ruby-2.2.4 ruby-2.2.4 - #removing src/ruby-2.2.4.. ruby-2.2.4 - #removing rubies/ruby-2.2.4.. Searching for binary rubies, this might take some time. No binary rubies…
jackerman09
  • 2,492
  • 5
  • 29
  • 46
0
votes
2 answers

How to add a relationship so that related object would appear in a certain position in ActiveRecord CollectionProxy?

Situation: I have 4 models with relationships like these: class A < ActiveRecord::Base belongs_to :b belongs_to :c belongs_to :d end class B < ActiveRecord::Base has_many :as, dependent: :destroy end class C < ActiveRecord::Base …
Andres
  • 2,099
  • 3
  • 22
  • 39
0
votes
1 answer

Rails - Implementing a "like" feature and experiencing an infinite loop

I'm honestly not even sure where to start with this problem but I've implemented a "like" feature on my site and when I'm looking at the console I see a REALLY REALLY long SQL statement. I'm not going to post all of my dev.log because it's just…
Luke Xu
  • 2,302
  • 3
  • 19
  • 43
0
votes
2 answers

Why does "instance.send(:initialize, *args, **kwargs, &block)" fail only from within Class#new?

I've been stuck on this for quite a while now. Take a look at this: class SuperClass def self.new(*args, **kwargs, &block) i = allocate() # Extra instance setup code here i.send(:initialize, *args, **kwargs, &block) return i …
Hubro
  • 56,214
  • 69
  • 228
  • 381
0
votes
0 answers

How do I avoid duplicate key warnings in Ruby 2.2 with Watir?

Using watir-webdriver with Selenium I have element selectors with duplicate key warnings like browser.div(class: 'one-possible-class', class: 'another-possible-class') This works perfectly to resolve to elements that match either one or both of the…
emery
  • 8,603
  • 10
  • 44
  • 51
0
votes
1 answer

Faye Websocket example bug?

Over at Faye Websocket for Ruby, there is a specific example that is not working for me. https://raw.githubusercontent.com/faye/faye-websocket-ruby/master/examples/app.rb require 'faye/websocket' require 'permessage_deflate' require 'rack' static …
CZauX
  • 109
  • 2
  • 9
0
votes
1 answer

How to know if ffmpeg conversion succeeded in Ruby?

I run the ffmpeg command to convert audio files to mp3 in my rails application: # Convert to MP3 conversion_result = `ffmpeg -i "#{Refile::cache.directory}/#{self.file.id}" -f mp3 "#{_path_to_mp3}" 2>&1` After the conversion, an example of…
tozlu
  • 4,667
  • 3
  • 30
  • 44