# Ruby

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

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

---

## [Smtp.set\_debug\_output - capture output to string?](https://www.ruby-forum.com/t/smtp-set-debug-output-capture-output-to-string/127527)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 4\
**Last updated:** [January 30, 2008, 2:54am UTC](https://www.ruby-forum.com/t/smtp-set-debug-output-capture-output-to-string/127527 "2008-01-30T02:54:13Z")

</div>

As shown below, I can send debug output from Net::SMTP to stderr, how to I send this to a string instead? smtp = Net::SMTP.new(x\[:address\], x\[:port\]) smtp.set\_debug\_output $stderr smtp.start(x\[:domain\], x\[:user\_name\]…

---

## [Newbie question 'require'](https://www.ruby-forum.com/t/newbie-question-require/127520)

<div class="topic-metadata">

**Author:** [@Serg\_K](https://www.ruby-forum.com/u/Serg_K)\
**Replies:** 5\
**Last updated:** [January 30, 2008, 1:41am UTC](https://www.ruby-forum.com/t/newbie-question-require/127520 "2008-01-30T01:41:33Z")

</div>

Hi I’ve installed the sqlite3-ruby gem via gem install. However when I do a: require ‘sqlite3’ I get a LoadError: no such file to load â€” sqlite3. This is on Mac OSX 10.5.2. Yes I have slite3 installed and w…

---

## [Problem with rbwfile in Registry: killed tooltips in FxRuby?](https://www.ruby-forum.com/t/problem-with-rbwfile-in-registry-killed-tooltips-in-fxruby/127522)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 0\
**Last updated:** [January 30, 2008, 1:25am UTC](https://www.ruby-forum.com/t/problem-with-rbwfile-in-registry-killed-tooltips-in-fxruby/127522 "2008-01-30T01:25:43Z")

</div>

Hi, What is the definition of the data item in the HKEY\_LOCAL\_MACHINE \\SOFTWARE\\Classes\\rbwFile’s “EditFlags” value? I’m running FxRuby programs on a WinXP/SP2 machine. I changed the EditFlags’ value from 8 to 0 the …

---

## [Looking for XML parsers in Ruby](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454)

<div class="topic-metadata">

**Author:** [@ravindra](https://www.ruby-forum.com/u/ravindra)\
**Replies:** 5\
**Last updated:** [January 30, 2008, 12:56am UTC](https://www.ruby-forum.com/t/looking-for-xml-parsers-in-ruby/127454 "2008-01-30T00:56:20Z")

</div>

Hi, I am looking for a validating XML parser for ruby. I found that there are libxml-ruby and ruby interface to expat available. Could someone please tell me which is the better in terms of performance and functional…

---

## [Applying a random method to an object](https://www.ruby-forum.com/t/applying-a-random-method-to-an-object/127515)

<div class="topic-metadata">

**Author:** [@bor\_S](https://www.ruby-forum.com/u/bor_S)\
**Replies:** 1\
**Last updated:** [January 29, 2008, 11:24pm UTC](https://www.ruby-forum.com/t/applying-a-random-method-to-an-object/127515 "2008-01-29T23:24:38Z")

</div>

A weblog showed that .methods could be sorted and behaved like an array (which I had not noticed before). Now I’m trying (somewhat unsuccesfully) to find a way (including google and the ruby doc) to apply for example …

---

## [What's the diff between puts y and puts "#{y}" in class\_eval](https://www.ruby-forum.com/t/whats-the-diff-between-puts-y-and-puts-y-in-class-eval/127320)

<div class="topic-metadata">

**Author:** [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Replies:** 6\
**Last updated:** [January 29, 2008, 11:18pm UTC](https://www.ruby-forum.com/t/whats-the-diff-between-puts-y-and-puts-y-in-class-eval/127320 "2008-01-29T23:18:09Z")

</div>

Look at the code. y = " another hi" class Wes end Wes.class\_eval \<\<-END def hello puts “#{y}” puts y # I get wrong number of arguments error end END While puts “#{y}” works puts y fails. And I am not sure what’…

---

## [NoMethodError when trying to validate model field](https://www.ruby-forum.com/t/nomethoderror-when-trying-to-validate-model-field/127414)

<div class="topic-metadata">

**Author:** [@laredotornado](https://www.ruby-forum.com/u/laredotornado)\
**Replies:** 1\
**Last updated:** [January 29, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/nomethoderror-when-trying-to-validate-model-field/127414 "2008-01-29T22:15:35Z")

</div>

Hi, When validating a field in my user model, I wrote a method “is\_client?” to help with the validation. But I did it wrong because now I’m getting this error: NoMethodError in SessionController#create undefined met…

---

## [Regex to avoid escaped quotes or double quotes](https://www.ruby-forum.com/t/regex-to-avoid-escaped-quotes-or-double-quotes/127497)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 0\
**Last updated:** [January 29, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/regex-to-avoid-escaped-quotes-or-double-quotes/127497 "2008-01-29T20:41:11Z")

</div>

I am doing an xpath compiler. Biggest problem is how to ignore single and double quoted literals … along with escaped quotes. Like the following (avoiding the quoted literal): /some/cool/xml/path\[fn:count(subelement…

---

## ["Fuzzy" matching of lines between CVS mailing lists](https://www.ruby-forum.com/t/fuzzy-matching-of-lines-between-cvs-mailing-lists/127487)

<div class="topic-metadata">

**Author:** [@philippeqc](https://www.ruby-forum.com/u/philippeqc)\
**Replies:** 1\
**Last updated:** [January 29, 2008, 8:35pm UTC](https://www.ruby-forum.com/t/fuzzy-matching-of-lines-between-cvs-mailing-lists/127487 "2008-01-29T20:35:54Z")

</div>

People, I am not sure if this is an appropriate place to ask this sort of question - there are probably dozens of different solutions with greatly varying amounts of time, effort and efficiency involved but since I li…

---

## [Ruby & Word 2007 help](https://www.ruby-forum.com/t/ruby-word-2007-help/112754)

<div class="topic-metadata">

**Author:** [@Inge\_Zwart](https://www.ruby-forum.com/u/Inge_Zwart)\
**Replies:** 13\
**Last updated:** [January 29, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/ruby-word-2007-help/112754 "2008-01-29T18:15:08Z")

</div>

I have a batchmacro that I use in Ruby with Word 2003. I converted to Word 2007 and now it doesn’t work. Can anyone tell me how to change the code? The code is below: batchmacro.rb Ruby script for batch running Wo…

---

## [Swiftiply configuration for rails application](https://www.ruby-forum.com/t/swiftiply-configuration-for-rails-application/127370)

<div class="topic-metadata">

**Author:** [@daffodil](https://www.ruby-forum.com/u/daffodil)\
**Replies:** 1\
**Last updated:** [January 29, 2008, 5:45pm UTC](https://www.ruby-forum.com/t/swiftiply-configuration-for-rails-application/127370 "2008-01-29T17:45:27Z")

</div>

Hi, Im trying to configure swiftiply and mongrel for my rails application. I followed the tutorial provided in the link: http://jit.nuance9.com/2007/11/rails-on â€¦ ngrel.html Im getting the following error when try…

---

## ['0\_2'.to\_i](https://www.ruby-forum.com/t/0-2-to-i/127464)

<div class="topic-metadata">

**Author:** [@Tadayoshi\_F](https://www.ruby-forum.com/u/Tadayoshi_F)\
**Replies:** 2\
**Last updated:** [January 29, 2008, 5:07pm UTC](https://www.ruby-forum.com/t/0-2-to-i/127464 "2008-01-29T17:07:29Z")

</div>

String#to\_i e$B$,@5$7$/5!G=$7$J$$$3$H$,$"$j$^$9!#e(Bruby e$B\<+?H$N;z6g2r\<a$H$be(B e$B0c$$$^$9!#$?$V$s!"e(B1.8 e$B$bF1$8$G$9!#e(B $ ./ruby -v -e ‘p “0\_2”.to\_i’ ruby 1.9.0 (2008-01-29 revision 0) \[i386-freebsd6.2\] 0 e…

---

## [FireWatir in class, link doesn't work](https://www.ruby-forum.com/t/firewatir-in-class-link-doesnt-work/126923)

<div class="topic-metadata">

**Author:** [@flamingflamingo](https://www.ruby-forum.com/u/flamingflamingo)\
**Replies:** 7\
**Last updated:** [January 29, 2008, 3:33pm UTC](https://www.ruby-forum.com/t/firewatir-in-class-link-doesnt-work/126923 "2008-01-29T15:33:47Z")

</div>

Hi All, In the code below I’m making a first try to make a class with FireWatir/firefox. Now, the problem is, the clicklink doesn’t work, I do get the puts’s but with the self.link there is no action(and the link doe…

---

## [Adding instance variables using module include](https://www.ruby-forum.com/t/adding-instance-variables-using-module-include/127361)

<div class="topic-metadata">

**Author:** [@ghoti143](https://www.ruby-forum.com/u/ghoti143)\
**Replies:** 2\
**Last updated:** [January 29, 2008, 2:16pm UTC](https://www.ruby-forum.com/t/adding-instance-variables-using-module-include/127361 "2008-01-29T14:16:43Z")

</div>

Hi there, If I have a module and class like this: module VisitMemory def mark\_visited(method) @methods\_visited \<\< method.my\_declaration\_signature end def already\_visited?(method) @methods\_visited.include?(metho…

---

## [Can you do this ? ruby aptitute](https://www.ruby-forum.com/t/can-you-do-this-ruby-aptitute/127449)

<div class="topic-metadata">

**Author:** [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Replies:** 3\
**Last updated:** [January 29, 2008, 1:18pm UTC](https://www.ruby-forum.com/t/can-you-do-this-ruby-aptitute/127449 "2008-01-29T13:18:07Z")

</div>

in source1.rb class C1 def met @bb puts @bb end end in source2.rb require ‘source1.rb’ class C2 def met @aa=10 C1.new.met end end #------------- see above source code how to pass @aa(in C2) value to @bb(i…

---

## [Spreadsheet Excel: How to merge cells?](https://www.ruby-forum.com/t/spreadsheet-excel-how-to-merge-cells/127446)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 1\
**Last updated:** [January 29, 2008, 1:10pm UTC](https://www.ruby-forum.com/t/spreadsheet-excel-how-to-merge-cells/127446 "2008-01-29T13:10:58Z")

</div>

Hello. I’m using spreadsheet-excel-0.3.5.1 on Windows XP with Excel 2000 and ruby 1.8.6. I’m trying to merge some cells, but don’t succeed in doing so :confused: Here’s my code: require ‘spreadsheet/excel’ EXCEL\_RE…

---

## [Amsterdam.rb](https://www.ruby-forum.com/t/amsterdam-rb/126795)

<div class="topic-metadata">

**Author:** [@remvee](https://www.ruby-forum.com/u/remvee)\
**Replies:** 7\
**Last updated:** [January 29, 2008, 12:58pm UTC](https://www.ruby-forum.com/t/amsterdam-rb/126795 "2008-01-29T12:58:05Z")

</div>

Hi all, On the 28th of January the first amsterdam.rb meeting will be celebrated with beers. Come to Nieuwmarkt square\[1\] to join us for beers at “De Bekeerde Suster”\[2\]. There’s no website yet, no plans on what or…

---

## [/\\x40\\z/ =~ "\\x81\\x40".force\_encoding("GBK")](https://www.ruby-forum.com/t/x40-z-x81-x40-force-encoding-gbk/127453)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [January 29, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/x40-z-x81-x40-force-encoding-gbk/127453 "2008-01-29T12:50:03Z")

</div>

GBK e$B$G$Oe(B \\x81\\x40 e$B$OC10l$NJ8;z$@$H;W$&$N$G$9$,!"0J2\<$N$h$&$Ke(B e$B$9$k$H8e$mH\>J,$Ne(B \\x40 e$B$K%^%C%A$7$^$9!#e(B % ./ruby -ve ‘p(/\\x40\\z/ =~ “\\x81\\x40”.force\_encoding(“GBK”))’ ruby 1.9.0 (2008-01-29 revisio…

---

## [Problem loading a YAML file](https://www.ruby-forum.com/t/problem-loading-a-yaml-file/127392)

<div class="topic-metadata">

**Author:** [@keith](https://www.ruby-forum.com/u/keith)\
**Replies:** 6\
**Last updated:** [January 29, 2008, 12:13pm UTC](https://www.ruby-forum.com/t/problem-loading-a-yaml-file/127392 "2008-01-29T12:13:28Z")

</div>

I’m having issues loading a YAML file. Here is the YAML file (named test.yml): foo: 5 bar: some string Here is my Ruby: C:\\noozler\\trunk\>ruby script/console Loading development environment (Rails 2.0.2) require …

---

## [/#{}/e.encoding](https://www.ruby-forum.com/t/e-encoding/127205)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 4\
**Last updated:** [January 29, 2008, 10:05am UTC](https://www.ruby-forum.com/t/e-encoding/127205 "2008-01-29T10:05:10Z")

</div>

e$B0J2\<$N$h$&$Ke(B /#{}/e e$B$Ne(B encoding e$B$,e(B US-ASCII e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘p(/#{}/e.encoding)’ ruby 1.9.0 (2008-01-26 revision 15237) \[i686-linux\] #Encoding:US-ASCII e$B@55,I=8=$N%=!\<%9$r9=@.$9$k…

---

## [Logical Operations on Strings](https://www.ruby-forum.com/t/logical-operations-on-strings/127325)

<div class="topic-metadata">

**Author:** [@Michael\_WSRyder](https://www.ruby-forum.com/u/Michael_WSRyder)\
**Replies:** 5\
**Last updated:** [January 29, 2008, 9:38am UTC](https://www.ruby-forum.com/t/logical-operations-on-strings/127325 "2008-01-29T09:38:06Z")

</div>

Is there a bitwise and for strings that I am missing? I tried the documentation and Google with no luck. I coded a simple method to handle this, it obviously needs more error checking, but don’t want to reinvent the…

---

## [Coerce via aliased methods](https://www.ruby-forum.com/t/coerce-via-aliased-methods/125988)

<div class="topic-metadata">

**Author:** [@Yugui](https://www.ruby-forum.com/u/Yugui)\
**Replies:** 1\
**Last updated:** [January 29, 2008, 9:26am UTC](https://www.ruby-forum.com/t/coerce-via-aliased-methods/125988 "2008-01-29T09:26:21Z")

</div>

Yuguie$B$G$9!#e(B Fixnume$B$Ne(Bcoercee$B$9$k1i;;$O!"%(%$%j%"%97PM3$G;HMQ$9$k$HNce(B e$B30$r@8$8$k$h$&$G$9!#e(B e$B\<!$N%3!\<%I$Oe(B1.8e$B$G$Oe(B"successfully coerced"e$B$H=PNO$7e(B e$B$^$9$,!"e(Btrunke$B$G$Oe(BNoMetho…

---

## [Regexp match /.../n against to UTF-8 string](https://www.ruby-forum.com/t/regexp-match-n-against-to-utf-8-string/127202)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 3\
**Last updated:** [January 29, 2008, 6:58am UTC](https://www.ruby-forum.com/t/regexp-match-n-against-to-utf-8-string/127202 "2008-01-29T06:58:20Z")

</div>

e$B0J2\<$N$h$&$K!"$D$1$F$b$$$J$$@55,I=8=$Ne(B n e$B%\*%W%7%g%s$K4X$7$Fe(B e$B7Y9p$,=P$^$9!#e(B % ./ruby -ve '# -- coding:us-ascii -- /a/ = ~ “\\xc2\\x81”.force\_encoding(“utf-8”) ’ ruby 1.9.0 (2008-01-26 revision 15248) …

---

## [Re: Making Change (#154)](https://www.ruby-forum.com/t/re-making-change-154/127435)

<div class="topic-metadata">

**Author:** [@jameskelly](https://www.ruby-forum.com/u/jameskelly)\
**Replies:** 0\
**Last updated:** [January 29, 2008, 5:39am UTC](https://www.ruby-forum.com/t/re-making-change-154/127435 "2008-01-29T05:39:14Z")

</div>

My solution uses a queue of combinations of coins. In the basic algorithm, in each iteration, it dequeues the first element, creates a new combination combining it with one of each type of coin (i.e.: the Cartesian pr…

---

## [$B%3%s%Q%$%k$NLdBj(B](https://www.ruby-forum.com/t/b-3-s-q-k-nldbj-b/127260)

<div class="topic-metadata">

**Author:** [@drenovac](https://www.ruby-forum.com/u/drenovac)\
**Replies:** 9\
**Last updated:** [January 29, 2008, 4:32am UTC](https://www.ruby-forum.com/t/b-3-s-q-k-nldbj-b/127260 "2008-01-29T04:32:55Z")

</div>

e$B8=:\_e(B (r15264 e$B$Ge(B) e$B%3%s%Q%$%k;HMQ$H$9$k$H!“%(%i!\<$K$J$j$^$9e(B: ruby -Ks ./tool/insns2vm.rb --srcdir=”." /cygdrive/d/ruby/tool/instruction.rb:169:in \`raise’: unhandled exception e$B$I$NMM$KBP1~$7$?$i$$$$…

---

## [Enc/euc\_kr.c (euckr\_mbc\_enc\_len) euc\_kr.c is also used by CP942](https://www.ruby-forum.com/t/enc-euc-kr-c-euckr-mbc-enc-len-euc-kr-c-is-also-used-by-cp942/127326)

<div class="topic-metadata">

**Author:** [@NARUSES\_Yui](https://www.ruby-forum.com/u/NARUSES_Yui)\
**Replies:** 9\
**Last updated:** [January 29, 2008, 4:28am UTC](https://www.ruby-forum.com/t/enc-euc-kr-c-euckr-mbc-enc-len-euc-kr-c-is-also-used-by-cp942/127326 "2008-01-29T04:28:14Z")

</div>

e$B@.@%$G$9!#e(B r15288 | akr | 2008-01-28 13:02:39 +0900 (Mon, 28 Jan 2008) | 2 lines enc/euc\_kr.c (euckr\_mbc\_enc\_len): validation implemented. e$B$3$l$Oe(B /\[\\x00-\\x7F\]|\[\\xA1-\\xFE\]{2}/ e$B0J30$r=3$k$H$$$&\<q;\]$J$N…

---

## [Disable database support?](https://www.ruby-forum.com/t/disable-database-support/127347)

<div class="topic-metadata">

**Author:** [@anjelika](https://www.ruby-forum.com/u/anjelika)\
**Replies:** 2\
**Last updated:** [January 29, 2008, 1:24am UTC](https://www.ruby-forum.com/t/disable-database-support/127347 "2008-01-29T01:24:46Z")

</div>

Hello, By default a new rails project comes with database enabled (by adding -d option to your rails command when creating a new project you can change the DBMS, by defaulds it says it’s mysql but in rails 2.0.2 is s…

---

## [Re: tail call elimination](https://www.ruby-forum.com/t/re-tail-call-elimination/127417)

<div class="topic-metadata">

**Author:** [@Michael\_TSRichter](https://www.ruby-forum.com/u/Michael_TSRichter)\
**Replies:** 0\
**Last updated:** [January 29, 2008, 12:57am UTC](https://www.ruby-forum.com/t/re-tail-call-elimination/127417 "2008-01-29T00:57:49Z")

</div>

Does ruby implement tail call elimination? ~ $ irb irb(main):001:0\> def loop irb(main):002:1\> loop irb(main):003:1\> end =\> nil irb(main):004:0\> loop SystemStackError: stack level too deep from (irb):2:in…

---

## [Line breaks in YAML](https://www.ruby-forum.com/t/line-breaks-in-yaml/127398)

<div class="topic-metadata">

**Author:** [@keith](https://www.ruby-forum.com/u/keith)\
**Replies:** 4\
**Last updated:** [January 29, 2008, 12:07am UTC](https://www.ruby-forum.com/t/line-breaks-in-yaml/127398 "2008-01-29T00:07:15Z")

</div>

Sorry for all the YAML questions today! Here is my YAML file- foo: this is a test to see if ruby recognizes line breaks Here is my Ruby- Loading development environment (Rails 2.0.2) require ‘yaml’ =\> \[\] te…

---

## [Ruby is Running Slow on Mac OS X](https://www.ruby-forum.com/t/ruby-is-running-slow-on-mac-os-x/127401)

<div class="topic-metadata">

**Author:** [@superfly](https://www.ruby-forum.com/u/superfly)\
**Replies:** 2\
**Last updated:** [January 28, 2008, 11:24pm UTC](https://www.ruby-forum.com/t/ruby-is-running-slow-on-mac-os-x/127401 "2008-01-28T23:24:55Z")

</div>

Hello everyone. I’m just wondering if anyone else is having problems, or did have problems with ruby running very slowly on your mac? My mac is new, opened 5 days ago. I have it on a loop, and on average it took 10-30 …

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

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