# Ruby

**URL:** https://www.ruby-forum.com/c/ruby/7.md?page=1133

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 1134

---

## [enum\_for(:each\_with\_index)$B$NAj0c(B](https://www.ruby-forum.com/t/enum-for-each-with-index-b-naj0c-b/137298)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [May 12, 2008, 1:26pm UTC](https://www.ruby-forum.com/t/enum-for-each-with-index-b-naj0c-b/137298 "2008-05-12T13:26:29Z")

</div>

e$B$k$S$-$A$G$9!#e(B Ruby 1.8.7e$B$He(BRuby 1.9e$B$Ne(B each\_with\_index e$B$Ne(BEnumeratore$B$N5sF0$,0\[$J$j$^$9!#e(B require ‘enumerator’ RUBY\_VERSION # =\> “1.8.6” %w\[foo bar\].enum\_for(:each\_with\_…

---

## [Rubygems-update and Mac OS X 10.4.11](https://www.ruby-forum.com/t/rubygems-update-and-mac-os-x-10-4-11/137343)

<div class="topic-metadata">

**Author:** [@Une\_BSSSSvS\_ue](https://www.ruby-forum.com/u/Une_BSSSSvS_ue)\
**Replies:** 3\
**Last updated:** [May 12, 2008, 12:40pm UTC](https://www.ruby-forum.com/t/rubygems-update-and-mac-os-x-10-4-11/137343 "2008-05-12T12:40:44Z")

</div>

I’ve done : $ sudo gem install --local rubygems-update getting: Successfully installed rubygems-update-1.1.1 1 gem installed however: $ gem --version 1.1.0 same result if the attempt made with remotely available …

---

## [Compilation error in cont.c](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069)

<div class="topic-metadata">

**Author:** [@deliak](https://www.ruby-forum.com/u/deliak)\
**Replies:** 8\
**Last updated:** [May 12, 2008, 11:42am UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069 "2008-05-12T11:42:04Z")

</div>

Hi, with ruby 1.9.0-1, I get the following error during the cross-compilation : cont.o -c cont.c cont.c: In function cont\_restore\_0': cont.c:327: error: structure has no member namedmachine\_stack\_src’ make: \*\*\* \[con…

---

## [Array#uniq with Hash elements... can't remove duplicates](https://www.ruby-forum.com/t/array-uniq-with-hash-elements-cant-remove-duplicates/137319)

<div class="topic-metadata">

**Author:** [@andrea](https://www.ruby-forum.com/u/andrea)\
**Replies:** 3\
**Last updated:** [May 12, 2008, 10:36am UTC](https://www.ruby-forum.com/t/array-uniq-with-hash-elements-cant-remove-duplicates/137319 "2008-05-12T10:36:12Z")

</div>

Hello, I am having some trouble trying to remove duplicate data from an array of hashes. I’ve read on the pickaxe book that Array#uniq detects duplicates using the eql? method on the elements, but it doesn’t seem to …

---

## [Auto mapping of setters/getters?](https://www.ruby-forum.com/t/auto-mapping-of-setters-getters/137337)

<div class="topic-metadata">

**Author:** [@cldwalker](https://www.ruby-forum.com/u/cldwalker)\
**Replies:** 3\
**Last updated:** [May 12, 2008, 9:50am UTC](https://www.ruby-forum.com/t/auto-mapping-of-setters-getters/137337 "2008-05-12T09:50:26Z")

</div>

Hi, After quite a long time, I’ve been looking at upgrading my application’s JRuby support from somewhere on the order of 0.3.x (or thereabouts) up to 1.1.1. One of the things my application does is generate classes o…

---

## [Comparing String with Symbol](https://www.ruby-forum.com/t/comparing-string-with-symbol/137060)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 15\
**Last updated:** [May 12, 2008, 8:58am UTC](https://www.ruby-forum.com/t/comparing-string-with-symbol/137060 "2008-05-12T08:58:12Z")

</div>

Hi, losts of Ruby methods allow String or Symbol as parameter, for example: \[“AAA”,“BBB”\].send(‘first’) =\> “AAA” \[“AAA”,“BBB”\].send(:first) =\> “AAA” If I want to accespt String or Symbol, is there an easy wat to al…

---

## [Problem finding purelib.rb when compiling Ruby 1.9](https://www.ruby-forum.com/t/problem-finding-purelib-rb-when-compiling-ruby-1-9/137335)

<div class="topic-metadata">

**Author:** [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Replies:** 0\
**Last updated:** [May 12, 2008, 5:10am UTC](https://www.ruby-forum.com/t/problem-finding-purelib-rb-when-compiling-ruby-1-9/137335 "2008-05-12T05:10:02Z")

</div>

I’m getting errors that purelib.rb can’t be found compiling Ruby 1.9 on MacOS 10.5.2. ruby trunk r16372 mkdir ruby1.9 cd ruby1.9/ svn co http://svn.ruby-lang.org/repos/ruby/trunk src cd src autoconf ./configure -…

---

## [Mechanize 0.7.6 Released](https://www.ruby-forum.com/t/mechanize-0-7-6-released/137334)

<div class="topic-metadata">

**Author:** [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Replies:** 0\
**Last updated:** [May 12, 2008, 4:37am UTC](https://www.ruby-forum.com/t/mechanize-0-7-6-released/137334 "2008-05-12T04:37:52Z")

</div>

mechanize version 0.7.6 has been released! http://mechanize.rubyforge.org/ The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, …

---

## [Writing pipe on Windows problem](https://www.ruby-forum.com/t/writing-pipe-on-windows-problem/136754)

<div class="topic-metadata">

**Author:** [@phasis](https://www.ruby-forum.com/u/phasis)\
**Replies:** 1\
**Last updated:** [May 12, 2008, 3:51am UTC](https://www.ruby-forum.com/t/writing-pipe-on-windows-problem/136754 "2008-05-12T03:51:06Z")

</div>

Hi, all I tested pipe with this code: readPipe, writePipe = IO.pipe t = Thread.new { puts “got #{readPipe.readline.length} bytes” } sleep 1 puts “hello from main” writePipe.puts “a”\*2048 t.join It works on Linux,…

---

## [Defined? a &&= 0](https://www.ruby-forum.com/t/defined-a-0/136604)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 3\
**Last updated:** [May 12, 2008, 3:42am UTC](https://www.ruby-forum.com/t/defined-a-0/136604 "2008-05-12T03:42:33Z")

</div>

e$B0J2\<$N$h$&$K!“e(Bdefined? a &&= 0 e$B$,e(B nil e$B$K$J$j$^$9$,!”$3$l$O0Ue(B e$B?^E\*$G$7$g$&$+e(B? % ./ruby -ve ‘p(defined? a &&= 0)’ ruby 1.9.0 (2008-05-02 revision 16284) \[i686-linux\] nil 1.8 e$B$G$Oe(B “expres…

---

## [Erasing text from a file](https://www.ruby-forum.com/t/erasing-text-from-a-file/137289)

<div class="topic-metadata">

**Author:** [@genericguy](https://www.ruby-forum.com/u/genericguy)\
**Replies:** 6\
**Last updated:** [May 12, 2008, 3:19am UTC](https://www.ruby-forum.com/t/erasing-text-from-a-file/137289 "2008-05-12T03:19:56Z")

</div>

To me it seems it should be a rather obvious thing, but no matter where I look, I can’t find how to erase text from a file or clear a file. The only things I have found are moving the the cursor to the start and writi…

---

## [A site for all your programming language needs](https://www.ruby-forum.com/t/a-site-for-all-your-programming-language-needs/137329)

<div class="topic-metadata">

**Author:** [@surana](https://www.ruby-forum.com/u/surana)\
**Replies:** 0\
**Last updated:** [May 12, 2008, 3:10am UTC](https://www.ruby-forum.com/t/a-site-for-all-your-programming-language-needs/137329 "2008-05-12T03:10:58Z")

</div>

A complete tutorial for all your programming language needs such as Java, .Net and many more. A one shop site for all your programming language needs http://www.computenetwork.blogspot.com

---

## [Container wont contain! (noob question)](https://www.ruby-forum.com/t/container-wont-contain-noob-question/137315)

<div class="topic-metadata">

**Author:** [@gastrogreen](https://www.ruby-forum.com/u/gastrogreen)\
**Replies:** 4\
**Last updated:** [May 11, 2008, 11:18pm UTC](https://www.ruby-forum.com/t/container-wont-contain-noob-question/137315 "2008-05-11T23:18:06Z")

</div>

Here I want to change Class1’s var2 to equal 2. Now, I can do this by… “object.m\_container.container1 = Class1.new(2)”, but I want to do it with “object.change\_me = 2” Point is I want to change that variable by simply…

---

## [Gchart 0.5.0 Released](https://www.ruby-forum.com/t/gchart-0-5-0-released/137314)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 0\
**Last updated:** [May 11, 2008, 10:22pm UTC](https://www.ruby-forum.com/t/gchart-0-5-0-released/137314 "2008-05-11T22:22:59Z")

</div>

gchart version 0.5.0 has been released! GChart exposes the Google Chart API (http://code.google.com/apis/chart) via a friendly Ruby interface. It can generate the URL for a given chart (for webpage use), or download …

---

## [RailsConf Registration](https://www.ruby-forum.com/t/railsconf-registration/137311)

<div class="topic-metadata">

**Author:** [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Replies:** 0\
**Last updated:** [May 11, 2008, 10:20pm UTC](https://www.ruby-forum.com/t/railsconf-registration/137311 "2008-05-11T22:20:38Z")

</div>

I registered for O’Reilly RailsConf, but I can’t make it, so I’m looking to sell my ticket. This ticket includes Thursday, the tutorial day and these 2 classes: Thursday Morning Tutorials: Hands-on Rapid Rails Develop…

---

## [Extracting HTML](https://www.ruby-forum.com/t/extracting-html/137306)

<div class="topic-metadata">

**Author:** [@flawkes](https://www.ruby-forum.com/u/flawkes)\
**Replies:** 2\
**Last updated:** [May 11, 2008, 9:21pm UTC](https://www.ruby-forum.com/t/extracting-html/137306 "2008-05-11T21:21:22Z")

</div>

Hi! I have a problem, and I can’t find the solution. I’m developing an app, (with ruby on rails) and I’m trying to create a PDF with some information that I have in my database. The situation is the next one: In my d…

---

## [Expected XYZcontroller.rb to define XYZ](https://www.ruby-forum.com/t/expected-xyzcontroller-rb-to-define-xyz/137307)

<div class="topic-metadata">

**Author:** [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Replies:** 1\
**Last updated:** [May 11, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/expected-xyzcontroller-rb-to-define-xyz/137307 "2008-05-11T20:55:38Z")

</div>

Hi Guys, I have a page - http://www.pilotoutlook.com/flying\_club/dosearch which was working fine and then I changed the code and I started having some issues. So, I reverted it back but I am still having following er…

---

## [Sharing variables between classes and instances](https://www.ruby-forum.com/t/sharing-variables-between-classes-and-instances/137264)

<div class="topic-metadata">

**Author:** [@leonb](https://www.ruby-forum.com/u/leonb)\
**Replies:** 6\
**Last updated:** [May 11, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/sharing-variables-between-classes-and-instances/137264 "2008-05-11T19:50:43Z")

</div>

Hi all, What I’m trying to achieve: add a variable to a class. Fill it with data. Every nstance of that class should have access to the data in that variable. But I want every instance be able to modify that variable, …

---

## [Code Review: MutableString5](https://www.ruby-forum.com/t/code-review-mutablestring5/137191)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 4\
**Last updated:** [May 11, 2008, 7:13pm UTC](https://www.ruby-forum.com/t/code-review-mutablestring5/137191 "2008-05-11T19:13:05Z")

</div>

tfpt review /shelveset:MutableString5;REDMOND\\tomat A new implementation for Ruby MutableString and Ruby regular expression wrappers. This is just the first pass, w/o optimizations and w/o encodings (Default system e…

---

## [Monday May 12: Phoenix Ruby User Group Meeting](https://www.ruby-forum.com/t/monday-may-12-phoenix-ruby-user-group-meeting/137303)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [May 11, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/monday-may-12-phoenix-ruby-user-group-meeting/137303 "2008-05-11T18:54:16Z")

</div>

May Phoenix Ruby U. Group Meeting Date: Monday, May 12, 2008 Time: 6:00 pm - Socializing 6:30 pm - Official start of meeting Place: Happy Camper Studios 4643 E. Thomas Rd, Suite #3 Phoenix, AZ 85018 (602) 714-11…

---

## [Ruby-GetText-Package-1.91.0](https://www.ruby-forum.com/t/ruby-gettext-package-1-91-0/137300)

<div class="topic-metadata">

**Author:** [@Masao\_M](https://www.ruby-forum.com/u/Masao_M)\
**Replies:** 0\
**Last updated:** [May 11, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/ruby-gettext-package-1-91-0/137300 "2008-05-11T17:55:29Z")

</div>

Hi, Ruby-GetText-Package-1.91.0 is now available. Changes Works on Win32 + JRuby-1.1.1 Fix memory leaks. Fix bugs. Speed up. Support Serbian(sr) Rails Support rubyonrails-1.2.x isn’t supported(2.0.0 or later are sup…

---

## [How to tell if script running under rubyw vs ruby?](https://www.ruby-forum.com/t/how-to-tell-if-script-running-under-rubyw-vs-ruby/137254)

<div class="topic-metadata">

**Author:** [@jsimone](https://www.ruby-forum.com/u/jsimone)\
**Replies:** 4\
**Last updated:** [May 11, 2008, 5:07pm UTC](https://www.ruby-forum.com/t/how-to-tell-if-script-running-under-rubyw-vs-ruby/137254 "2008-05-11T17:07:20Z")

</div>

I spent some time poking around in Config, but so far this is the the only thing I’ve found that works: begin puts ‘this is a test’ here is ruby rescue here is rubyw end And I really don’t love the side effect when…

---

## [Ruby keyboard commando switch off](https://www.ruby-forum.com/t/ruby-keyboard-commando-switch-off/137248)

<div class="topic-metadata">

**Author:** [@roky](https://www.ruby-forum.com/u/roky)\
**Replies:** 3\
**Last updated:** [May 11, 2008, 4:31pm UTC](https://www.ruby-forum.com/t/ruby-keyboard-commando-switch-off/137248 "2008-05-11T16:31:31Z")

</div>

I’m not really a master with ruby, so I would nicely want to ask if someone would know how to disable some keyboard keys. My friend and me are making a little game and in the engine we work there is a bug that if you …

---

## [Re: RubyForge bug fixes](https://www.ruby-forum.com/t/re-rubyforge-bug-fixes/137295)

<div class="topic-metadata">

**Author:** [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Replies:** 0\
**Last updated:** [May 11, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/re-rubyforge-bug-fixes/137295 "2008-05-11T16:15:40Z")

</div>

Hi Peter, Fantastic point, now that I am understanding the code, it makes perfect sense, I really appriciate the comments. Thanks. ----- Original Message ---- From: Peter Bacon D. removed\_email\_address@domain.invali…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/137292)

<div class="topic-metadata">

**Author:** [@editkid](https://www.ruby-forum.com/u/editkid)\
**Replies:** 3\
**Last updated:** [May 11, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/no-subject/137292 "2008-05-11T15:26:20Z")

</div>

It would be useful to have a helper function to clean up this kind of code. Or is there one and I can’t find it? RubyUtils.GetConstant(context, rubyClass, SymbolTable.StringToId(mutableString.ConvertToString()), true…

---

## [Validation of date\_select](https://www.ruby-forum.com/t/validation-of-date-select/137288)

<div class="topic-metadata">

**Author:** [@dummschwaetz](https://www.ruby-forum.com/u/dummschwaetz)\
**Replies:** 2\
**Last updated:** [May 11, 2008, 2:18pm UTC](https://www.ruby-forum.com/t/validation-of-date-select/137288 "2008-05-11T14:18:27Z")

</div>

I’m new to ror. I need to check a date in a form. I’m validating if the datefields (I used a date\_select) are empty. In case they are not all three fiels (d, m, y) get a red background, but only the selectfield for th…

---

## [Re: RubyForge bug fixes](https://www.ruby-forum.com/t/re-rubyforge-bug-fixes/137263)

<div class="topic-metadata">

**Author:** [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Replies:** 1\
**Last updated:** [May 11, 2008, 2:16pm UTC](https://www.ruby-forum.com/t/re-rubyforge-bug-fixes/137263 "2008-05-11T14:16:20Z")

</div>

Hi John, Here is my code that I have, this is the first method I attemepted since this is one of the interesting logic. I thought I post my code for you to review as well. This passed most of the test as well\[ { ret…

---

## [Cgi.header redirect](https://www.ruby-forum.com/t/cgi-header-redirect/136820)

<div class="topic-metadata">

**Author:** [@haris](https://www.ruby-forum.com/u/haris)\
**Replies:** 3\
**Last updated:** [May 11, 2008, 11:59am UTC](https://www.ruby-forum.com/t/cgi-header-redirect/136820 "2008-05-11T11:59:56Z")

</div>

Hi! I tried to redirect a html page to itself to avoid browser’s question about resending post data but it doesn’t work. I tried this: cgi=CGI.new cgi.header(‘status’=\>‘302 moved’, ‘location’=\>‘my\_page.rb’) or cg…

---

## [Yaml load error (when using cgi)](https://www.ruby-forum.com/t/yaml-load-error-when-using-cgi/136822)

<div class="topic-metadata">

**Author:** [@Une\_BSSSSvS\_ue](https://www.ruby-forum.com/u/Une_BSSSSvS_ue)\
**Replies:** 4\
**Last updated:** [May 11, 2008, 9:45am UTC](https://www.ruby-forum.com/t/yaml-load-error-when-using-cgi/136822 "2008-05-11T09:45:34Z")

</div>

i’ve a cgi wanted to make use of yaml and i get this error reported by Apache2 : \[Tue May 06 12:25:50 2008\] \[error\] mod\_ruby: error in ruby \[Tue May 06 12:25:50 2008\] \[error\] mod\_ruby: /opt/local/lib/ruby/1.8/yaml.rb…

---

## [IronRuby r100 on Mono](https://www.ruby-forum.com/t/ironruby-r100-on-mono/136890)

<div class="topic-metadata">

**Author:** [@Sanghyeon\_S](https://www.ruby-forum.com/u/Sanghyeon_S)\
**Replies:** 15\
**Last updated:** [May 11, 2008, 5:35am UTC](https://www.ruby-forum.com/t/ironruby-r100-on-mono/136890 "2008-05-11T05:35:45Z")

</div>

WARNING: This is against revision 100. Revision 101 will compile, but will not run on Mono at the time. I am still working on it. In case you didn’t know, you can use “svn update -r 100” to “update” to not-the-latest …

[Previous page](https://www.ruby-forum.com/c/ruby/7.md?page=1132)

[Next page](https://www.ruby-forum.com/c/ruby/7.md?page=1134)
