# Ruby

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

[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:** 537

---

## [Convert date](https://www.ruby-forum.com/t/convert-date/194558)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 6\
**Last updated:** [September 7, 2010, 9:50am UTC](https://www.ruby-forum.com/t/convert-date/194558 "2010-09-07T09:50:52Z")

</div>

in my irb console: irb(main):001:0\> require ‘rubygems’ =\> true irb(main):002:0\> require ‘date’ =\> false irb(main):003:0\> puts Date.parse(“oct”).to\_s.split("-")\[1\] 10 =\> nil 1.why irb(main):002:0\> require ‘dat…

---

## [Encrypt passwords](https://www.ruby-forum.com/t/encrypt-passwords/194449)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 3\
**Last updated:** [September 7, 2010, 9:44am UTC](https://www.ruby-forum.com/t/encrypt-passwords/194449 "2010-09-07T09:44:25Z")

</div>

hi i have a ruby script screenscraping my bank. how can i encypt the userid/password in the ruby so that even if someone steals my script, they will not have access to my passwords.

---

## [How to write this xpath?](https://www.ruby-forum.com/t/how-to-write-this-xpath/194560)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 4\
**Last updated:** [September 7, 2010, 9:37am UTC](https://www.ruby-forum.com/t/how-to-write-this-xpath/194560 "2010-09-07T09:37:58Z")

</div>

there is an html file ok Sep 10 | Oct 10 | Dec 10 123 567 when i open it with firefox,the output is : ok Sep 10 | Oct 10 | Dec 10 123 567 what i want to get is ok Sep 10 | Oct 10 | Dec 10 here is my cod…

---

## [Rvm and macruby 0.6](https://www.ruby-forum.com/t/rvm-and-macruby-0-6/194564)

<div class="topic-metadata">

**Author:** [@lirh](https://www.ruby-forum.com/u/lirh)\
**Replies:** 0\
**Last updated:** [September 7, 2010, 8:35am UTC](https://www.ruby-forum.com/t/rvm-and-macruby-0-6/194564 "2010-09-07T08:35:18Z")

</div>

Hi, I installed macruby 0.6 through rvm, but irb gave the following error message: $ irb No such file or directory - open() failed (Errno::ENOENT) In fact, this irb program is a bash script, which exec macirb in the …

---

## [Embedded ruby leaves $: empty](https://www.ruby-forum.com/t/embedded-ruby-leaves-empty/194554)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 1\
**Last updated:** [September 7, 2010, 6:45am UTC](https://www.ruby-forum.com/t/embedded-ruby-leaves-empty/194554 "2010-09-07T06:45:51Z")

</div>

What’s the best way, when embedding Ruby via ruby\_init() and such in C, to give it all the same RUBYPATH style library paths as a ruby.exe shell call would see? Where “best” generally means portable to other people’s …

---

## [Problem with 'chomp'](https://www.ruby-forum.com/t/problem-with-chomp/194547)

<div class="topic-metadata">

**Author:** [@barryjogorman](https://www.ruby-forum.com/u/barryjogorman)\
**Replies:** 8\
**Last updated:** [September 7, 2010, 5:21am UTC](https://www.ruby-forum.com/t/problem-with-chomp/194547 "2010-09-07T05:21:34Z")

</div>

Simple program: while($\_ != “q”) puts “Running…” print "Enter q to quit: " gets chomp end However - getting the following in any progams in which I use ‘chomp’: 'undefined local variable or method ‘chomp’ for mai…

---

## [ActiveRecord loading veeeery slow](https://www.ruby-forum.com/t/activerecord-loading-veeeery-slow/192891)

<div class="topic-metadata">

**Author:** [@michbukana](https://www.ruby-forum.com/u/michbukana)\
**Replies:** 2\
**Last updated:** [September 7, 2010, 5:00am UTC](https://www.ruby-forum.com/t/activerecord-loading-veeeery-slow/192891 "2010-09-07T05:00:46Z")

</div>

Hi all, I’m having a performance issue when loading activerecord: I’m timing it in this code puts Time.now.to\_s + “rubygems” require ‘rubygems’ puts Time.now.to\_s + “activerecord” require ‘active\_record’ puts Time.…

---

## [Parsing, BNF, TreeTop, GhostWheel,](https://www.ruby-forum.com/t/parsing-bnf-treetop-ghostwheel/193191)

<div class="topic-metadata">

**Author:** [@Philipp\_K](https://www.ruby-forum.com/u/Philipp_K)\
**Replies:** 12\
**Last updated:** [September 7, 2010, 3:17am UTC](https://www.ruby-forum.com/t/parsing-bnf-treetop-ghostwheel/193191 "2010-09-07T03:17:29Z")

</div>

Hi, I’m looking for a parser which can be fed with some (A)BNF-style rules. Gave TreeTop a try —cut--------------------------------------------------------- grammar MathGrammar rule additive multitive ‘+’ additive …

---

## [Wrong: an introspecting assert library](https://www.ruby-forum.com/t/wrong-an-introspecting-assert-library/194484)

<div class="topic-metadata">

**Author:** [@combas](https://www.ruby-forum.com/u/combas)\
**Replies:** 6\
**Last updated:** [September 7, 2010, 1:49am UTC](https://www.ruby-forum.com/t/wrong-an-introspecting-assert-library/194484 "2010-09-07T01:49:40Z")

</div>

For WhyDay, I took the time to clean up and document Wrong, a project Steve C. and I have been working on. It’s inspired by assert{2.0} (http://assert2.rubyforge.org/) but rewritten from scratch. Major kudos to Phlip …

---

## [A better idiomatic way of doing this?!](https://www.ruby-forum.com/t/a-better-idiomatic-way-of-doing-this/194430)

<div class="topic-metadata">

**Author:** [@timrohde](https://www.ruby-forum.com/u/timrohde)\
**Replies:** 11\
**Last updated:** [September 6, 2010, 9:38pm UTC](https://www.ruby-forum.com/t/a-better-idiomatic-way-of-doing-this/194430 "2010-09-06T21:38:37Z")

</div>

Hi Im new at Ruby and been struggling with this lab I have for a course Im doing in Ruby. Im working on a program were you can register guests and unregister and so on. What I need to do now is to present a menu throu…

---

## [Use Maven/Ant to compile JRuby script to JAR](https://www.ruby-forum.com/t/use-maven-ant-to-compile-jruby-script-to-jar/193787)

<div class="topic-metadata">

**Author:** [@stephanos](https://www.ruby-forum.com/u/stephanos)\
**Replies:** 4\
**Last updated:** [September 6, 2010, 8:40pm UTC](https://www.ruby-forum.com/t/use-maven-ant-to-compile-jruby-script-to-jar/193787 "2010-09-06T20:40:08Z")

</div>

Hi folks, here is an example of what I want to do: I have a ruby script ‘prime.rb’ with a method ‘isPrimeNumber(num)’ which should be compiled into a JAR ‘prime.jar’. It should be possible to use this JAR from a Java…

---

## [Problems using the Mysql gem](https://www.ruby-forum.com/t/problems-using-the-mysql-gem/194437)

<div class="topic-metadata">

**Author:** [@jimb](https://www.ruby-forum.com/u/jimb)\
**Replies:** 3\
**Last updated:** [September 6, 2010, 8:03pm UTC](https://www.ruby-forum.com/t/problems-using-the-mysql-gem/194437 "2010-09-06T20:03:52Z")

</div>

Hi, I’m using the mysql (2.8.1 x86-mingw32) gem and MySQL Server version 5.0.90 on Windows 7, 64 bit. I’m also using ruby 1.8.7. When I run the following script (replacing user name and password appropriately) requi…

---

## [My First Application](https://www.ruby-forum.com/t/my-first-application/194434)

<div class="topic-metadata">

**Author:** [@jdhale](https://www.ruby-forum.com/u/jdhale)\
**Replies:** 5\
**Last updated:** [September 6, 2010, 6:44pm UTC](https://www.ruby-forum.com/t/my-first-application/194434 "2010-09-06T18:44:15Z")

</div>

I have worked with PHP in the past and have been playing with Ruby for a few weeks. I made a program that I would love to get feedback on. Any comments would be great. I have my program on Git hub. http://github.co…

---

## [Read cookie](https://www.ruby-forum.com/t/read-cookie/194388)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 28\
**Last updated:** [September 6, 2010, 6:40pm UTC](https://www.ruby-forum.com/t/read-cookie/194388 "2010-09-06T18:40:44Z")

</div>

How can I get the value of a browser cookie with Ruby?

---

## [Odd functional programming question](https://www.ruby-forum.com/t/odd-functional-programming-question/194466)

<div class="topic-metadata">

**Author:** [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Replies:** 9\
**Last updated:** [September 6, 2010, 5:32pm UTC](https://www.ruby-forum.com/t/odd-functional-programming-question/194466 "2010-09-06T17:32:48Z")

</div>

Ok this is probably not really functional programming but I was just noodling about with Ruby when I thought “it would be quite nice if I could do X”. In this case X is as follows: def X(text, action) x.action end …

---

## [LibXMLJRuby is not missing constant XML!](https://www.ruby-forum.com/t/libxmljruby-is-not-missing-constant-xml/194313)

<div class="topic-metadata">

**Author:** [@guipereira](https://www.ruby-forum.com/u/guipereira)\
**Replies:** 1\
**Last updated:** [September 6, 2010, 5:26pm UTC](https://www.ruby-forum.com/t/libxmljruby-is-not-missing-constant-xml/194313 "2010-09-06T17:26:09Z")

</div>

Hi, anyone have the solution for this problem? I have gem RXSD and it need libxml-jruby. This works with ruby but with jruby gives an error : ArgumentError (LibXMLJRuby is not missing constant XML!): libxml-jruby (1…

---

## [ActiveRecord and incrementing the key](https://www.ruby-forum.com/t/activerecord-and-incrementing-the-key/194413)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 5\
**Last updated:** [September 6, 2010, 4:58pm UTC](https://www.ruby-forum.com/t/activerecord-and-incrementing-the-key/194413 "2010-09-06T16:58:37Z")

</div>

In “The Rails Way” book, the following is mentiond in Chapter (6):Working with ActiveRecord “Also by convention, ActiveRecord will expect an id column to use as primary key. It should be an integer and \[\[incrementing …

---

## [Getting name of current method](https://www.ruby-forum.com/t/getting-name-of-current-method/194510)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 4\
**Last updated:** [September 6, 2010, 4:52pm UTC](https://www.ruby-forum.com/t/getting-name-of-current-method/194510 "2010-09-06T16:52:23Z")

</div>

Ruby has FILE and LINE to give the file and line omber where we are currently at in the code. Consider Class X def my\_method m = ??? # I want m to be assigned “my\_method” end end How can I get m set properly? I…

---

## [Ruby looping](https://www.ruby-forum.com/t/ruby-looping/194412)

<div class="topic-metadata">

**Author:** [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Replies:** 3\
**Last updated:** [September 6, 2010, 4:50pm UTC](https://www.ruby-forum.com/t/ruby-looping/194412 "2010-09-06T16:50:53Z")

</div>

Hey, I have a quick query regarding loops, I am reading a CSV file take the information from the first line of the CSV file and calling an object which does some stuff, then I want to move on to the next line in the …

---

## [Seeking a new Quizmaster](https://www.ruby-forum.com/t/seeking-a-new-quizmaster/194444)

<div class="topic-metadata">

**Author:** [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Replies:** 3\
**Last updated:** [September 6, 2010, 4:44pm UTC](https://www.ruby-forum.com/t/seeking-a-new-quizmaster/194444 "2010-09-06T16:44:09Z")

</div>

Dear Rubyists, You may have noticed a substantial drop off in Ruby Q.zes over the past few months. I haven’t fallen off the face of the Earth, but with my current projects I’m unable to make time for administering Rub…

---

## [Ruby\_archive 0.1.0 released](https://www.ruby-forum.com/t/ruby-archive-0-1-0-released/194502)

<div class="topic-metadata">

**Author:** [@ngng](https://www.ruby-forum.com/u/ngng)\
**Replies:** 9\
**Last updated:** [September 6, 2010, 4:44pm UTC](https://www.ruby-forum.com/t/ruby-archive-0-1-0-released/194502 "2010-09-06T16:44:08Z")

</div>

After a summer of working on various ways to implement it, I’m happy to announce that I’m putting the first release of my Ruby Summer of Code project, ruby\_archive 0.1.0, out into the wild. It’s available on rubygems …

---

## [Slow Find.find - real problem](https://www.ruby-forum.com/t/slow-find-find-real-problem/194411)

<div class="topic-metadata">

**Author:** [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Replies:** 7\
**Last updated:** [September 6, 2010, 4:42pm UTC](https://www.ruby-forum.com/t/slow-find-find-real-problem/194411 "2010-09-06T16:42:53Z")

</div>

Hey, I have a real head ache and would really appreciate any advice. I have a folder with 100,000’s of files within it and I need to run a rename process across these. def renameFile(oldID, newID) Find.find(@pdfDIR)…

---

## [\[Ruby 1.9-Bug#3791\]\[Open\] Ruby 1.9.2$B$N(BReadline.readline$B$H(BReadline.line\_buffer$B$N%(%s%](https://www.ruby-forum.com/t/ruby-1-9-bug-3791-open-ruby-1-9-2-b-n-breadline-readline-b-h-breadline-line-buffer-b-n-s/194519)

<div class="topic-metadata">

**Author:** [@Motohiro\_KOSAKI](https://www.ruby-forum.com/u/Motohiro_KOSAKI)\
**Replies:** 0\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3791-open-ruby-1-9-2-b-n-breadline-readline-b-h-breadline-line-buffer-b-n-s/194519 "2010-09-06T16:39:56Z")

</div>

Bug #3791: Ruby 1.9.2e$B$Ne(BReadline.readlinee$B$He(BReadline.line\_buffere$B$N%(%s%3!\<%G%#%s%0$NHs8\_49e(B http://redmine.ruby-lang.org/issues/show/3791 e$B5/I\<\<Te(B: Motohiro KOSAKI e$B%9%F!\<%?%9e(B: Open, e$BM%@hEY…

---

## [Matz's slides from Rubykaigi?](https://www.ruby-forum.com/t/matzs-slides-from-rubykaigi/194386)

<div class="topic-metadata">

**Author:** [@diego\_v](https://www.ruby-forum.com/u/diego_v)\
**Replies:** 2\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/matzs-slides-from-rubykaigi/194386 "2010-09-06T16:39:55Z")

</div>

Hello, (I guess this is mostly directed at Matz but I thought of sending it here since it may interest other people too.) Would it be possible to have somewhere accessible online Matz’s slides from this year Rubykaig…

---

## [GUI for commandline programs](https://www.ruby-forum.com/t/gui-for-commandline-programs/197149)

<div class="topic-metadata">

**Author:** [@Handy\_G](https://www.ruby-forum.com/u/Handy_G)\
**Replies:** 8\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/gui-for-commandline-programs/197149 "2010-09-06T16:39:55Z")

</div>

I’m looking for a simple, easy to learn, low weight GUI for use in Ruby programs that mainly use the command line but where a bit of GUI might be in order. To give a clearer idea, let me show some examples: Going …

---

## [Load path](https://www.ruby-forum.com/t/load-path/194296)

<div class="topic-metadata">

**Author:** [@tensaiji](https://www.ruby-forum.com/u/tensaiji)\
**Replies:** 10\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/load-path/194296 "2010-09-06T16:39:54Z")

</div>

Hi, I’ve discovered that the load path is different if I run sudo, specifically it doesn’t pick up the value in GEM\_HOME, even though sudo echo $GEM\_HOME shows the correct path. Everything else I’ve checked between su…

---

## [Uninitialized constant NArray (Name Error)](https://www.ruby-forum.com/t/uninitialized-constant-narray-name-error/194334)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 11\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-narray-name-error/194334 "2010-09-06T16:39:54Z")

</div>

Following section (2) here: http://ruby.gfd-dennou.org/tutorial/gokuraku/index-e.html Trying to run this part of script I have so far: require ‘narray’ ary1 = NArray.sfloat(3,4) I get the following error: C:\\Users\\…

---

## [Event Resolution Framework](https://www.ruby-forum.com/t/event-resolution-framework/194367)

<div class="topic-metadata">

**Author:** [@callyworld](https://www.ruby-forum.com/u/callyworld)\
**Replies:** 9\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/event-resolution-framework/194367 "2010-09-06T16:39:53Z")

</div>

Has anyone ever pursued creating a library/framework for the abstract management of event resolution models? I’m coding a game where character actions of all players are planned ahead of time, and then these actions a…

---

## [\[Ruby 1.9-Bug#3790\]\[Open\] Float('0x') $B$,%(%i!\<$K$J$i$J$$(B](https://www.ruby-forum.com/t/ruby-1-9-bug-3790-open-float-0x-b-i-k-j-i-j-b/194511)

<div class="topic-metadata">

**Author:** [@tadayoshi\_funaba](https://www.ruby-forum.com/u/tadayoshi_funaba)\
**Replies:** 0\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3790-open-float-0x-b-i-k-j-i-j-b/194511 "2010-09-06T16:39:53Z")

</div>

Bug #3790: Float(‘0x’) e$B$,%(%i!\<$K$J$i$J$$e(B http://redmine.ruby-lang.org/issues/show/3790 e$B5/I\<\<Te(B: tadayoshi funaba e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Low ruby -v: ruby 1.9.3dev (2010-09-04) \[i686-linux\] …

---

## [Mailread.rb missing/deprec in 1.9?](https://www.ruby-forum.com/t/mailread-rb-missing-deprec-in-1-9/194265)

<div class="topic-metadata">

**Author:** [@sentinel](https://www.ruby-forum.com/u/sentinel)\
**Replies:** 1\
**Last updated:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/mailread-rb-missing-deprec-in-1-9/194265 "2010-09-06T16:39:53Z")

</div>

I am unable to find mailread.rb (for reading mboxes) in 1.9 either in my installations, or in the docs at ruby-doc.org. Has it been removed ? btw, I copied the file from 1.8 and it works under 1.9.2. (Also, Is there …

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

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