Questions tagged [ruby-1.9]

Ruby 1.9 is a shortcut for ruby versions 1.9.1, 1.9.2 and 1.9.3. Ruby is a dynamic language that focuses on simplicity and expressiveness.

Ruby is a dynamic language that focuses on simplicity and expressiveness.

Ruby 1.9 is the successor of Ruby version 1.8, there are the subversions 1.9.1, 1.9.2 and 1.9.3. The successor Ruby 2.0 was published 2013-02-24.

Ruby 1.9 is incompatible with Ruby 1.8, the succcessor Ruby 2.0 is intended to be fully backward compatible with Ruby 1.9.3.

Ruby 1.9 introduced new features like:

  • Per-string character encodings are supported
  • Block local variables (variables that are local to the block in which they are declared)
  • An additional lambda syntax
  • New socket API (IPv6 support)
  • require_relative import security
429 questions
0
votes
2 answers

Ruby: what is the pitfall in this simple code excerpt that tests variable existence

I'm starting with Ruby, and while making some test samples, I've stumbled against an error in the code that I don't understand why it happens. The code pretends to tests if a variable finn is defined?() and if it is defined, then it increments it.…
zipizap
  • 633
  • 6
  • 13
0
votes
3 answers

How does integer-float comparison work?

The following expression evaluated to true on Ruby 1.9: 31964252037939931209 == 31964252037939933000.0 # => true but I have no clue how this is happening. Am I missing something here?
Siva
  • 7,780
  • 6
  • 47
  • 54
0
votes
1 answer

I get an Exception when trying to implement reset password with Authlogic

I'm using Ruby on Rails 2.3.5 and Ruby 1.9 and implmeneted Authlogic as my authentication engine. Authlogic works fine. But now I have been trying to implement password reset using the following…
Tam
  • 11,872
  • 19
  • 69
  • 119
0
votes
1 answer

How to sort the array in ruby

I have a following array arr = ["2014-05-02T19-49-55_1280x720_vga2usb.mp4", "2014-05-02T19-49-55_544x288_left_cam.mp4", "2014-05-02T19-49-55_544x288_right_cam.mp4", "2014-05-02T19-49-55_1632x288.mp4"] I need to sort this array in a way that I get…
user2622247
  • 1,059
  • 2
  • 15
  • 26
0
votes
2 answers

Find the file in the folder with specific end in ruby

I have many files in the folder, such as mp4, mov, avi files. But I have to find files that are end with "_college.mp4". I tried following way File.exists?("#{temp_dir}/*_college.mp4") But I not worked. How can I do this in ruby.
r15
  • 486
  • 1
  • 8
  • 22
0
votes
1 answer

ruby: unknown encoding name: undecided

I've actually figured out what causes this error, but Googling for it was unsuccessful so I thought I'd write it down here to help out other people. This error pops up when you've got an # -*- coding: undecided -*- comment at the top of one of your…
Natalie Weizenbaum
  • 5,884
  • 28
  • 22
0
votes
5 answers

Can't install ruby 1.9.1 on MacOSX 10.6

I can't seem to be get Ruby installed on my Mac. These are the steps I've taken so far: Downloaded the package from Ruby's site (http://www.ruby-lang.org/en/downloads/) Unpacked it running { tar xzvf ruby-1.9.1-p376.tar.gz } Went into the new ruby…
funkymunky
  • 1,811
  • 3
  • 20
  • 22
0
votes
1 answer

user must_send with a method that calls super in minitest

Lets say I have the following module: module SillyDemo class Monkey def screech(sound) sound end end class Ape < Monkey def process(sound) sound end def screech(sound) process(sound) …
Abraham P
  • 15,029
  • 13
  • 58
  • 126
0
votes
1 answer

Is the env $LANG setting equivalent to a "magic" utf-8 comment?

I had a Ruby script giving me an invalid multibyte char (US-ASCII) error. It turns out the server's $LANG env variable was not being set. Once I set it to en_US.UTF-8, the error went away. Does this mean export LANG="en_US.UTF-8" is equivalent to…
dgo.a
  • 2,634
  • 23
  • 35
0
votes
1 answer

Resuming Fiber on Async Method

I am not able to understand, why this code doesn't work. What I'm trying to do is emulate the synchronous code behavior using fiber. require 'fiber' require 'eventmachine' def async_request(url) f = Fiber.current Thread.new do sleep 0.3 …
CHAPa
  • 667
  • 8
  • 24
0
votes
1 answer

Redmine not start, log says ActiveRecord::AdapterNotSpecified, some other stranges

FreeBSD 9.2 Apache 2.4 + Passenger Trying to start Redmine 2.3.2 Error: /usr/local/lib/ruby/gems/1.9/gems/activerecord-3.2.13/lib/active_record /connection_adapters/abstract/connection_specification.rb:47:in `resolve_hash_connection': database…
0
votes
1 answer

preserving visibility when doing an alias_method_chain on attr_accessor in Ruby 1.9

I'm trying to port a library from ruby 1.8. I didn't write the library. I can change the API if absolutely necessary, but it does have a fair number of users I would prefer not to inconvenience. Here's the problem simplified: require…
Bryan Larsen
  • 9,468
  • 8
  • 56
  • 46
0
votes
1 answer

What happened with Ruby 1.9.2?

I have seen that there is no updates for Ruby 1.9.2. (Only for Ruby 1.9.3 & 2.0). My question is: what happened with 1.9.2? I'm confused if 1.9.3 and 1.9.2 are different branches, or 1.9.3 is the sequel, and if my 1.9.2 app will works with 1.9.3…
eveevans
  • 4,392
  • 2
  • 31
  • 38
0
votes
1 answer

Does the syntax for Rail's form_tag change under Ruby 1.9 and/or Rails 3.2?

I just recently upgraded a Rails project from Rails 3.0.10 and Ruby 1.8 to Rails 3.2 and Ruby 1.9. However, after the upgrade, one of the views that has never caused me trouble before is now throwing an error. The view code in question is from my…
grg-n-sox
  • 717
  • 2
  • 5
  • 25
0
votes
1 answer

Inconsistent IO character reading when converting encoding

In Ruby 1.9.3-429, I am trying to parse plain text files with various encodings that will ultimately be converted to UTF-8 strings. Non-ascii characters work fine with a file encoded as UTF-8, but problems come up with non-UTF-8 files. Simplified…
bbxiao1
  • 13
  • 3