# Ruby

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

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

---

## [Net::SSH serialized commands](https://www.ruby-forum.com/t/net-ssh-serialized-commands/157710)

<div class="topic-metadata">

**Author:** [@lyrics](https://www.ruby-forum.com/u/lyrics)\
**Replies:** 8\
**Last updated:** [January 15, 2009, 11:10am UTC](https://www.ruby-forum.com/t/net-ssh-serialized-commands/157710 "2009-01-15T11:10:28Z")

</div>

Hi, I am using Net::SSH v2 I want to execute a command when the first one is complete. But I can’t make it working. Here is my code: Net::SSH.start( addr, user, :password =\> passwd) do |session| session.exec! (“ser…

---

## [Prime.include?(1) hangs Ruby scripts and irb](https://www.ruby-forum.com/t/prime-include-1-hangs-ruby-scripts-and-irb/157777)

<div class="topic-metadata">

**Author:** [@Frisco\_Del\_R](https://www.ruby-forum.com/u/Frisco_Del_R)\
**Replies:** 1\
**Last updated:** [January 15, 2009, 10:20am UTC](https://www.ruby-forum.com/t/prime-include-1-hangs-ruby-scripts-and-irb/157777 "2009-01-15T10:20:30Z")

</div>

Ruby version 1.8.6 Mac OS 10.5.2 I would like a Ruby script to do something if a result is a prime number, or do something else if the result is not prime. But Ruby is hanging on instance\_of\_Prime.includes?(some prim…

---

## [A Hash problem](https://www.ruby-forum.com/t/a-hash-problem/157781)

<div class="topic-metadata">

**Author:** [@on9west](https://www.ruby-forum.com/u/on9west)\
**Replies:** 2\
**Last updated:** [January 15, 2009, 10:03am UTC](https://www.ruby-forum.com/t/a-hash-problem/157781 "2009-01-15T10:03:20Z")

</div>

Dear all I want to build a hash which store the values from database, but failed. Please give me some hints please. Thank you. services table h\_code s\_code status AHN BBS 3 AHN …

---

## [Catching system signals (UNIX)](https://www.ruby-forum.com/t/catching-system-signals-unix/157778)

<div class="topic-metadata">

**Author:** [@voice](https://www.ruby-forum.com/u/voice)\
**Replies:** 1\
**Last updated:** [January 15, 2009, 9:25am UTC](https://www.ruby-forum.com/t/catching-system-signals-unix/157778 "2009-01-15T09:25:42Z")

</div>

Hello. I have little program (daemon), most of time it waiting with sleep method. I need to catch system’s signal SIGTERM, to terminate my program correctly. How can I do this? Thanks.

---

## [Calling Ruby from Delphi](https://www.ruby-forum.com/t/calling-ruby-from-delphi/156304)

<div class="topic-metadata">

**Author:** [@robredford](https://www.ruby-forum.com/u/robredford)\
**Replies:** 6\
**Last updated:** [January 15, 2009, 8:34am UTC](https://www.ruby-forum.com/t/calling-ruby-from-delphi/156304 "2009-01-15T08:34:39Z")

</div>

I want to call an embedded ruby function from Delphi 2009. A C or C++ example is also ok. For example on the Ruby side: def myFunction(a,b,c) rv1=ab -c rv2=a2 + b2 rv3=bc return rv1, rv2, rv3 end The above funct…

---

## [A couple of questions about sqlite](https://www.ruby-forum.com/t/a-couple-of-questions-about-sqlite/157722)

<div class="topic-metadata">

**Author:** [@daveh0](https://www.ruby-forum.com/u/daveh0)\
**Replies:** 3\
**Last updated:** [January 15, 2009, 8:20am UTC](https://www.ruby-forum.com/t/a-couple-of-questions-about-sqlite/157722 "2009-01-15T08:20:38Z")

</div>

i am new to ruby and programming in general, and was wondering a couple of things. 1st, is there agood tutorial site to learn how to use sqlite? also, is there a gui available for sqlite? …

---

## [\[Bug #981\] String#encode() keeps invalid bytes when converting to US-ASCII](https://www.ruby-forum.com/t/bug-981-string-encode-keeps-invalid-bytes-when-converting-to-us-ascii/156896)

<div class="topic-metadata">

**Author:** [@Martin\_DSSS\_rst](https://www.ruby-forum.com/u/Martin_DSSS_rst)\
**Replies:** 2\
**Last updated:** [January 15, 2009, 8:07am UTC](https://www.ruby-forum.com/t/bug-981-string-encode-keeps-invalid-bytes-when-converting-to-us-ascii/156896 "2009-01-15T08:07:47Z")

</div>

Bug #981: String#encode() keeps invalid bytes when converting to US-ASCII http://redmine.ruby-lang.org/issues/show/981 e$B5/I\<\<Te(B: Martin De$(D+de(Brst e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$BC4Ev\<Te(B: Ak…

---

## [Reading RTF + Text File and pattern matching](https://www.ruby-forum.com/t/reading-rtf-text-file-and-pattern-matching/157513)

<div class="topic-metadata">

**Author:** [@prince\_tambar](https://www.ruby-forum.com/u/prince_tambar)\
**Replies:** 2\
**Last updated:** [January 15, 2009, 7:17am UTC](https://www.ruby-forum.com/t/reading-rtf-text-file-and-pattern-matching/157513 "2009-01-15T07:17:14Z")

</div>

Reading RTF and Text File in Ruby and Pattern Matching/searching from file and replacing with your data. if you want to read RTF of Text file then u can take help from this code . Try out following solution. filenam…

---

## [Central ffi site](https://www.ruby-forum.com/t/central-ffi-site/157774)

<div class="topic-metadata">

**Author:** [@Martin\_DeMello](https://www.ruby-forum.com/u/Martin_DeMello)\
**Replies:** 0\
**Last updated:** [January 15, 2009, 7:07am UTC](https://www.ruby-forum.com/t/central-ffi-site/157774 "2009-01-15T07:07:28Z")

</div>

There was some talk on the mailing list about setting up a central site for collecting ruby-ffi based bindings - did that come to anything? martin

---

## [Problems passing parameters into XSLT](https://www.ruby-forum.com/t/problems-passing-parameters-into-xslt/153449)

<div class="topic-metadata">

**Author:** [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Replies:** 2\
**Last updated:** [January 15, 2009, 5:30am UTC](https://www.ruby-forum.com/t/problems-passing-parameters-into-xslt/153449 "2009-01-15T05:30:03Z")

</div>

I’m having some problems passing parameters into XSLT with ruby. The following script, based on the example in the docs ----- run.rb #!/usr/bin/ruby require ‘rubygems’ require ‘xml’ require ‘xslt’ Create a new XS…

---

## [Yield example baffling - need help](https://www.ruby-forum.com/t/yield-example-baffling-need-help/157765)

<div class="topic-metadata">

**Author:** [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Replies:** 5\
**Last updated:** [January 15, 2009, 3:02am UTC](https://www.ruby-forum.com/t/yield-example-baffling-need-help/157765 "2009-01-15T03:02:23Z")

</div>

I’m studying the yield statement for the first time, today. All’s well until I see this example: def myeach(myarray) iter = 0 while (iter \< myarray.length): yield(myarray\[iter\]) iter += 1 end end testarray = \[1,…

---

## [Euruko 2009: Call for papers](https://www.ruby-forum.com/t/euruko-2009-call-for-papers/157755)

<div class="topic-metadata">

**Author:** [@fxn](https://www.ruby-forum.com/u/fxn)\
**Replies:** 0\
**Last updated:** [January 15, 2009, 1:24am UTC](https://www.ruby-forum.com/t/euruko-2009-call-for-papers/157755 "2009-01-15T01:24:07Z")

</div>

Hi folks! Just a brief mail to announce the call for papers for Euruko 2009: http://euruko2009.srug.org/ As you may know Euruko 2009 is going to be held in Barcelona, 9-10th of May. See you there! :slight\_smile: – …

---

## [Can't alias context from irb\_context](https://www.ruby-forum.com/t/cant-alias-context-from-irb-context/157712)

<div class="topic-metadata">

**Author:** [@hoshbad](https://www.ruby-forum.com/u/hoshbad)\
**Replies:** 2\
**Last updated:** [January 15, 2009, 12:32am UTC](https://www.ruby-forum.com/t/cant-alias-context-from-irb-context/157712 "2009-01-15T00:32:21Z")

</div>

Dear ruby-talk, I’m trying to write a friendly script that opens up an IRB session after loading some classes and making a few instance variables for fun and profit. My script looks roughly like this: #!/usr/bin/rub…

---

## [Code Review: MethodGroups2](https://www.ruby-forum.com/t/code-review-methodgroups2/157736)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 1\
**Last updated:** [January 15, 2009, 12:20am UTC](https://www.ruby-forum.com/t/code-review-methodgroups2/157736 "2009-01-15T00:20:18Z")

</div>

tfpt review “/shelveset:MethodGroups2;REDMOND\\tomat” Method goups refactoring. Splits RubyMethodGroupInfo into RubyLibraryMethodInfo, RubyMethodGroupInfo \<: RubyMethodGroupBase. Tomas

---

## [A beginner case question](https://www.ruby-forum.com/t/a-beginner-case-question/157702)

<div class="topic-metadata">

**Author:** [@taylorstrait](https://www.ruby-forum.com/u/taylorstrait)\
**Replies:** 7\
**Last updated:** [January 14, 2009, 11:51pm UTC](https://www.ruby-forum.com/t/a-beginner-case-question/157702 "2009-01-14T23:51:49Z")

</div>

I am using case in to determine the sorting method used for an array as so: def single\_choice(object) # sort answer order based on question.list\_method answers = object.answers sorted\_answers = case object.list\_metho…

---

## [Commonly agreed command line options gem?](https://www.ruby-forum.com/t/commonly-agreed-command-line-options-gem/157518)

<div class="topic-metadata">

**Author:** [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Replies:** 3\
**Last updated:** [January 14, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/commonly-agreed-command-line-options-gem/157518 "2009-01-14T23:32:59Z")

</div>

Hi, Is there a commonly agreed gem for parsing command line options of a script (ARGV) ? If no, does anyone know a good one ? In all cases (as I’m relatively new to Ruby), what heuristic do you use to select the gem…

---

## [Running rake db:drop db:create against Oracle database does nothing](https://www.ruby-forum.com/t/running-rake-db-drop-db-create-against-oracle-database-does-nothing/157734)

<div class="topic-metadata">

**Author:** [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Replies:** 2\
**Last updated:** [January 14, 2009, 10:20pm UTC](https://www.ruby-forum.com/t/running-rake-db-drop-db-create-against-oracle-database-does-nothing/157734 "2009-01-14T22:20:26Z")

</div>

Hi, Running the rake tasks db:drop and db:create seem to do nothing when running against an Oracle database using the activerecord-jbdc-adapter. Is this a known bug? At Adobe we are using 0.9 of the AR JDBC adapter…

---

## [Various problems after installing ruby 1.9.1](https://www.ruby-forum.com/t/various-problems-after-installing-ruby-1-9-1/157613)

<div class="topic-metadata">

**Author:** [@rubina](https://www.ruby-forum.com/u/rubina)\
**Replies:** 3\
**Last updated:** [January 14, 2009, 9:00pm UTC](https://www.ruby-forum.com/t/various-problems-after-installing-ruby-1-9-1/157613 "2009-01-14T21:00:44Z")

</div>

Team, I unzipped ruby 1.9.1 where ruby 1.8.6 was located and since then I am having some problems and therefore will appreciate some help. Please notice that I still CAN run my ruby scripts, at least the few I tried. …

---

## [Finding ruby.h](https://www.ruby-forum.com/t/finding-ruby-h/157657)

<div class="topic-metadata">

**Author:** [@John\_Ky](https://www.ruby-forum.com/u/John_Ky)\
**Replies:** 4\
**Last updated:** [January 14, 2009, 6:40pm UTC](https://www.ruby-forum.com/t/finding-ruby-h/157657 "2009-01-14T18:40:42Z")

</div>

Hi, I’m building ruby extensions across many different OSes and architectures. Does anyone know an easy way to find ruby.h on any given system? I’m told that perl has a “perl -V” or @ENV variable which gives some pa…

---

## [Very rank beginner](https://www.ruby-forum.com/t/very-rank-beginner/157632)

<div class="topic-metadata">

**Author:** [@Ropebender](https://www.ruby-forum.com/u/Ropebender)\
**Replies:** 9\
**Last updated:** [January 14, 2009, 6:30pm UTC](https://www.ruby-forum.com/t/very-rank-beginner/157632 "2009-01-14T18:30:41Z")

</div>

Help. I am a really new beginner looking at Ruby for the first time. I was trying to go through the tutorial “Ruby in 20 minutes” on a Windows XP machine using fxri. Some of the code does not work as in the examples…

---

## [Downloading an MP3 from the internet](https://www.ruby-forum.com/t/downloading-an-mp3-from-the-internet/157646)

<div class="topic-metadata">

**Author:** [@Nathaniel\_Escribano](https://www.ruby-forum.com/u/Nathaniel_Escribano)\
**Replies:** 5\
**Last updated:** [January 14, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/downloading-an-mp3-from-the-internet/157646 "2009-01-14T18:01:22Z")

</div>

I am trying to write a simple script that downloads a music file from the internet. For example: if i want to download http://cdn.stereogum.com/mp3/My%20Morning%20Jacket%20-%20Celebration%20(Live).mp3 how exactly wo…

---

## [Watir: Access an Object](https://www.ruby-forum.com/t/watir-access-an-object/157591)

<div class="topic-metadata">

**Author:** [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Replies:** 2\
**Last updated:** [January 14, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/watir-access-an-object/157591 "2009-01-14T17:07:30Z")

</div>

I need to access an object with Watir through the name without knowing what kind of object is. For example the control could be a button or a link and I would like to do something like: require ‘watir’ include Watir …

---

## [Starting a shell command without wait?](https://www.ruby-forum.com/t/starting-a-shell-command-without-wait/157694)

<div class="topic-metadata">

**Author:** [@masterpinki](https://www.ruby-forum.com/u/masterpinki)\
**Replies:** 1\
**Last updated:** [January 14, 2009, 3:24pm UTC](https://www.ruby-forum.com/t/starting-a-shell-command-without-wait/157694 "2009-01-14T15:24:02Z")

</div>

Hi, I have a simple problem. I like to start simply executable on windows XP with a shell command as last step in the small script. Using system(“some.exe”), some.exe, exec(“some.exe”) or %x\[“some.exe”\] keeps always …

---

## [Trying to parse an array of rss feeds without success](https://www.ruby-forum.com/t/trying-to-parse-an-array-of-rss-feeds-without-success/157661)

<div class="topic-metadata">

**Author:** [@lpdahito](https://www.ruby-forum.com/u/lpdahito)\
**Replies:** 2\
**Last updated:** [January 14, 2009, 3:06pm UTC](https://www.ruby-forum.com/t/trying-to-parse-an-array-of-rss-feeds-without-success/157661 "2009-01-14T15:06:35Z")

</div>

hey folks, I’m trying to make a basic feeds parser… It works fine when I have one feed only but as soon as I try to parse an array of feeds, it’s gonna parse it correctly but I won’t be able to fetch any data out of i…

---

## [Irb documentation queries?](https://www.ruby-forum.com/t/irb-documentation-queries/157618)

<div class="topic-metadata">

**Author:** [@Benjamin\_JSRacine](https://www.ruby-forum.com/u/Benjamin_JSRacine)\
**Replies:** 2\
**Last updated:** [January 14, 2009, 2:34pm UTC](https://www.ruby-forum.com/t/irb-documentation-queries/157618 "2009-01-14T14:34:09Z")

</div>

Hello all, I am coming from python and loving ruby (the language), but trying to figure out some of the tools/capabilities. Would anyone be so kind as to tell me whether irb has a way of seeing documentation strings …

---

## [Complex CSV parsing](https://www.ruby-forum.com/t/complex-csv-parsing/157596)

<div class="topic-metadata">

**Author:** [@sclarke](https://www.ruby-forum.com/u/sclarke)\
**Replies:** 3\
**Last updated:** [January 14, 2009, 1:35pm UTC](https://www.ruby-forum.com/t/complex-csv-parsing/157596 "2009-01-14T13:35:37Z")

</div>

I am trying to parse data from a file where the values are common seperated, however there is slightly more to the file than just commas, see below for (;;);{“t”:“msg”,“c”:“p\_114000000”,“ms”:\[{“type”:“msg”,“msg”:{“te…

---

## [Implementing each and \<=\>](https://www.ruby-forum.com/t/implementing-each-and/157624)

<div class="topic-metadata">

**Author:** [@sentinel](https://www.ruby-forum.com/u/sentinel)\
**Replies:** 10\
**Last updated:** [January 14, 2009, 10:33am UTC](https://www.ruby-forum.com/t/implementing-each-and/157624 "2009-01-14T10:33:59Z")

</div>

I have a data model and would like to let it be Enumerable. I want to confirm if this is the way of implementing each and \<=\> : def each @list.each { |item| yield item } end def \<=\>(other) @list \<=\> other end (le…

---

## [Survey Invitation : Ruby + GUI](https://www.ruby-forum.com/t/survey-invitation-ruby-gui/153668)

<div class="topic-metadata">

**Author:** [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Replies:** 5\
**Last updated:** [January 14, 2009, 9:48am UTC](https://www.ruby-forum.com/t/survey-invitation-ruby-gui/153668 "2009-01-14T09:48:45Z")

</div>

Everyone’s invited to take part in a short survey on using Ruby for GUI programming; I’d be grateful for 5 or 10 minutes of your time at: http://www.surveymonkey.com/s.aspx?sm=o2UwH3KcrOyLxKsh8mOJMg\_3d\_3d Even if you …

---

## [Rake: passing args to Task invoke](https://www.ruby-forum.com/t/rake-passing-args-to-task-invoke/157280)

<div class="topic-metadata">

**Author:** [@rjberry](https://www.ruby-forum.com/u/rjberry)\
**Replies:** 3\
**Last updated:** [January 14, 2009, 9:40am UTC](https://www.ruby-forum.com/t/rake-passing-args-to-task-invoke/157280 "2009-01-14T09:40:59Z")

</div>

I need to write a rake task that invokes other rake tasks. Can do that fine but cannot work out the syntax for tasks that take arguments. For example db:migrate. How would I give it a version? I’ve tried the followi…

---

## [The Mobile Application Development Challenge](https://www.ruby-forum.com/t/the-mobile-application-development-challenge/157605)

<div class="topic-metadata">

**Author:** [@adam](https://www.ruby-forum.com/u/adam)\
**Replies:** 1\
**Last updated:** [January 14, 2009, 8:51am UTC](https://www.ruby-forum.com/t/the-mobile-application-development-challenge/157605 "2009-01-14T08:51:39Z")

</div>

The meteoric growth in smartphones device volume and diversity is one of the few bright spots in the technology industry recently. But developers trying to build mobile apps are stymied by the extreme difficulty of wr…

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

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