Questions tagged [ruby-1.8]

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

Ruby is an open-source dynamic object-oriented interpreted language created by Yukihiro Matsumoto (Matz) in the 1990s.

Related tags:

140 questions
1
vote
3 answers

Equivalent of Array#Uniq in Ruby1.8.7

I posted a question earlier - Issues with DISTINCT when used in conjunction with ORDER to which I received a great answer which worked locally on my machine. However, when I pushed it to the server the code didn't do anything to the results... I…
Texas
  • 903
  • 1
  • 11
  • 31
1
vote
1 answer

Unexpected behavior from Ruby 'super' keyword - Nokogiri inheritance

The rules of Ruby's super keyword is that if it is called without arguments, all of the original arguments are forwarded. If it is called with explicit arguments, the explicit arguments are exclusively passed in. In this example, arguments should…
Joseph Ravenwolfe
  • 6,480
  • 6
  • 31
  • 31
1
vote
1 answer

Testing Ruby code snippets with eval() in Ruby 1.9

I would like to use eval() in Ruby 1.9 to test little pieces of ruby code in an interactive way. A long time ago (around Ruby 1.4) I found a neat script on the internet providing this functionality. Here is simplified and reduced version: line =…
Paul Pladijs
  • 18,628
  • 5
  • 28
  • 31
1
vote
1 answer

undefined method "has_attached_file" with paperclip

I'm getting some unexpected behavior from my app while Upgrading to from Rails 2.3.11 to 3.1, particularly in relation to Paperclip. I've added the gem 'paperclip' to my Gemfile, and I ran bundle install and all seems to go well, except that when I…
Josh Kovach
  • 7,679
  • 3
  • 45
  • 62
1
vote
1 answer

Text Field in Rails whose size increases dynamically

I am trying to implement a groups feature similar to that of Facebook in my project. I am using Rails 2.0.2 and Ruby 1.8.7 for project specific purposes. I am using Ubuntu 10.04 OS. I want to implement a text field for the Discussion Topic and the…
boddhisattva
  • 6,908
  • 11
  • 48
  • 72
1
vote
1 answer

Does Ruby 1.8.7 head support 1.9-style hash literals?

According to http://redmine.ruby-lang.org/issues/1183 , Ruby 1.9's {foo: 42} apparently was back-ported to Ruby 1.8. But I tried running ruby-1.8.7-head using RVM, and I got the standard syntax error: Andrew-Grimms-MacBook-Pro:ruby agrimm$ rvm use…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
1
vote
4 answers

Handling string encoding with the same code in Ruby 1.8 and 1.9

I've got a gem that's used a bunch of people using a bunch of different Ruby interpreters, and it includes what boils down to this code: res = RestClient.post(...) doc = REXML::Document.new(res).root The content of res is always UTF-8, and this…
lambshaanxy
  • 22,552
  • 10
  • 68
  • 92
1
vote
1 answer

Ruby 1.8: Hash#sort not return hash but array (better way to do this?)

In some scenario of Ruby 1.8. If I have a hash # k is name, v is order foo = { "Jim" => 1, "bar" => 1, "joe" => 2} sorted_by_values = foo.sort {|a, b| a[1] <==> b[1]} #sorted_by_values is an array of array, it's no longer a…
Jirapong
  • 24,074
  • 10
  • 54
  • 72
1
vote
1 answer

backward-compatibily code for ruby 1.8 and ruby 2.1 not working on File module

I need to write some code that need to run on ruby 1.8 and ruby 2.1, and specifically opening a file in UTF-8 encoding, so I naively wrote that if RUBY_VERSION > "1.9" f = File.open('/usr/share/hwdata/pci.ids', encoding: "utf-8") else f =…
Baptiste Mille-Mathias
  • 2,144
  • 4
  • 31
  • 37
1
vote
1 answer

I'm running a Rails 2.3.4 app and am wondering if i should upgrade to 3.0?

i am developing a app and have been for a while using Rails 2.3.4 but I'm wondering if i should try to update, or keep waiting, never upgrade, i suppose I have a couple options. I am using ruby 1.8.7 would i need to upgrade that too huh? how…
loosecannon
  • 7,683
  • 3
  • 32
  • 43
1
vote
2 answers

What are the major differences between Ruby 1.8.6 and 1.9.1?

Possible Duplicate: What is the difference between Ruby 1.8 and Ruby 1.9 I have found some differences in interpretation of global and local variables. Can anyone point me to list of major differences?
themoah
  • 167
  • 2
  • 13
1
vote
1 answer

How to update Ruby in Google SketchUp?

Currently Google SketchUp for Mac has Ruby version 1.8.5 which I find a bit outdated. I can update Ruby to 1.8.7 (OSX's version) by the following commands $ cd /Applications/Google\ SketchUp\…
Andrei
  • 10,918
  • 12
  • 76
  • 110
1
vote
2 answers

Equivalent of String#setbyte and String#getbyte in ruby 1.8

Trying to get the aerospike ruby client to work under 1.8 What is the equivalent of these calls in ruby 1.8…
letronje
  • 9,002
  • 9
  • 45
  • 53
1
vote
1 answer

Error when using debugger - `require': no such file to load -- ruby-debug (LoadError)'

I created a breakpoint in the code below. When I run it in windows cmd using ruby test.rb, I get the error inrequire': no such file to load -- ruby-debug (LoadError)` Why does this error happen and how do I fix it ? class Dog def…
sid smith
  • 533
  • 1
  • 6
  • 18
1
vote
3 answers

Is there a fast and reliable way of serializing objects across different versions of Ruby?

I have two applications talking to each other using a queue, as of now they run exactly the same version of ruby (1.8.7), so I'm just marshaling objects back and forth; only objects from the standard lib mostly hashes, strings, time and date…
Camilo
  • 635
  • 1
  • 5
  • 9