# Ruby

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

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

---

## [C fwrite equivalent in ruby](https://www.ruby-forum.com/t/c-fwrite-equivalent-in-ruby/149865)

<div class="topic-metadata">

**Author:** [@lyes](https://www.ruby-forum.com/u/lyes)\
**Replies:** 3\
**Last updated:** [September 30, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/c-fwrite-equivalent-in-ruby/149865 "2008-09-30T23:01:24Z")

</div>

Hello list I want to know if there is an equivalent to the C function fwrite in ruby. Remeber that fwrite takes a buffer and a size of Bytes to write. the method “write” of the File object takes only the buffer to wr…

---

## [What gem needs to be installed so that 'require sqlite3' will work?](https://www.ruby-forum.com/t/what-gem-needs-to-be-installed-so-that-require-sqlite3-will-work/149894)

<div class="topic-metadata">

**Author:** [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Replies:** 2\
**Last updated:** [September 30, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/what-gem-needs-to-be-installed-so-that-require-sqlite3-will-work/149894 "2008-09-30T22:30:06Z")

</div>

I’ve installed sqlite3-ruby, but that wasn’t enough; I’m still getting: irb(main):001:0\> require ‘sqlite3’ LoadError: no such file to load – sqlite3 from (irb):1:in \`require’ from (irb):1 Thanks, Ken

---

## [Code Review: rubyspec4](https://www.ruby-forum.com/t/code-review-rubyspec4/149774)

<div class="topic-metadata">

**Author:** [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Replies:** 19\
**Last updated:** [September 30, 2008, 10:24pm UTC](https://www.ruby-forum.com/t/code-review-rubyspec4/149774 "2008-09-30T22:24:49Z")

</div>

This is a large diff due to updating Rubyspec, MSpec and Ironruby-tags. tfpt review “/shelveset:rubyspec4;REDMOND\\jdeville” Comment : Re-syncing MERLIN\_EXTERNAL mspec to the head of MSpec to pick up new tests. Re-ba…

---

## [\[ANN\] MysqlTableSyncer 0.2](https://www.ruby-forum.com/t/ann-mysqltablesyncer-0-2/149237)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 5\
**Last updated:** [September 30, 2008, 10:18pm UTC](https://www.ruby-forum.com/t/ann-mysqltablesyncer-0-2/149237 "2008-09-30T22:18:57Z")

</div>

Released a script recently to sync the contents of tables between two different mysql databases. The need for this is mostly as a faster, open source replacement to Navicat \[to those who have used it\] or SQLyog – sinc…

---

## [Syntax error](https://www.ruby-forum.com/t/syntax-error/149892)

<div class="topic-metadata">

**Author:** [@anicoll](https://www.ruby-forum.com/u/anicoll)\
**Replies:** 4\
**Last updated:** [September 30, 2008, 10:16pm UTC](https://www.ruby-forum.com/t/syntax-error/149892 "2008-09-30T22:16:26Z")

</div>

I’m a perlish person trying to get Ruby to talk to our Oracle 10g database. The following program gives me a syntax error I can’t resolve. I’ve looked at a lot of the website messages concerning the same error an no…

---

## [Definitive version of/docs for highline?](https://www.ruby-forum.com/t/definitive-version-of-docs-for-highline/149890)

<div class="topic-metadata">

**Author:** [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Replies:** 2\
**Last updated:** [September 30, 2008, 10:14pm UTC](https://www.ruby-forum.com/t/definitive-version-of-docs-for-highline/149890 "2008-09-30T22:14:16Z")

</div>

I’ve noticed there seem to be a couple of versions of the highline library out there. Could someone (James?) point me to the definitive site and docs? Thanks, Ken

---

## [Rake: undefined method \`to\_sym' for :Array](https://www.ruby-forum.com/t/rake-undefined-method-to-sym-for-array/149850)

<div class="topic-metadata">

**Author:** [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Replies:** 1\
**Last updated:** [September 30, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/rake-undefined-method-to-sym-for-array/149850 "2008-09-30T21:05:56Z")

</div>

When I run the example given in the rake documentation under “Tasks that expect parameters”, namely: task :name, \[:first\_name, :last\_name\] do |t, args| args.with\_defaults(:first\_name =\> “John”, :last\_name =\> “Dough”) …

---

## [Rexml exceptions](https://www.ruby-forum.com/t/rexml-exceptions/149811)

<div class="topic-metadata">

**Author:** [@ericw](https://www.ruby-forum.com/u/ericw)\
**Replies:** 7\
**Last updated:** [September 30, 2008, 8:55pm UTC](https://www.ruby-forum.com/t/rexml-exceptions/149811 "2008-09-30T20:55:55Z")

</div>

Is there any way to get any useful data out of REXML::ParseException when you’re working on a String? It never sets @position or @line or anything. I need to figure out exactly where the error-causing tag starts, and …

---

## [Ruby DCamp Update; Beginning Ruby Focus Added](https://www.ruby-forum.com/t/ruby-dcamp-update-beginning-ruby-focus-added/149879)

<div class="topic-metadata">

**Author:** [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Replies:** 0\
**Last updated:** [September 30, 2008, 7:57pm UTC](https://www.ruby-forum.com/t/ruby-dcamp-update-beginning-ruby-focus-added/149879 "2008-09-30T19:57:02Z")

</div>

Hello, everyone. It’s less than two weeks until Ruby DCamp! We’ve added Beginning Ruby as a suggested area of focus. As an Open Spaces conference, the content of the conference will be determined by you, the attendee…

---

## [Ruby cgi, add params and redirect](https://www.ruby-forum.com/t/ruby-cgi-add-params-and-redirect/149775)

<div class="topic-metadata">

**Author:** [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Replies:** 3\
**Last updated:** [September 30, 2008, 7:22pm UTC](https://www.ruby-forum.com/t/ruby-cgi-add-params-and-redirect/149775 "2008-09-30T19:22:30Z")

</div>

I’m looking for a way to add parameters to a cgi object and then redirect the user to another cgi script off site. require “cgi” cgi = CGI.new cgi.params\[‘new\_param’\] = “new\_value” … cgi.header(“status” =\> “302”, …

---

## [Detect whether unicode string is Japanese](https://www.ruby-forum.com/t/detect-whether-unicode-string-is-japanese/149768)

<div class="topic-metadata">

**Author:** [@bobm](https://www.ruby-forum.com/u/bobm)\
**Replies:** 1\
**Last updated:** [September 30, 2008, 7:17pm UTC](https://www.ruby-forum.com/t/detect-whether-unicode-string-is-japanese/149768 "2008-09-30T19:17:04Z")

</div>

How can I get a tally of how many characters in a Unicode string are Japanese (hiragana, katakana, kanji)? When I unpack a string, each character comes out like \\xE3\\x81\\x95, but I am trying to check if it’s in the ra…

---

## [Reliable character encodings conversion](https://www.ruby-forum.com/t/reliable-character-encodings-conversion/149845)

<div class="topic-metadata">

**Author:** [@Hubert\_SSSSSSSSSpic](https://www.ruby-forum.com/u/Hubert_SSSSSSSSSpic)\
**Replies:** 4\
**Last updated:** [September 30, 2008, 6:51pm UTC](https://www.ruby-forum.com/t/reliable-character-encodings-conversion/149845 "2008-09-30T18:51:50Z")

</div>

Hi, I am looking for reliable and error-resistant way to convert character encodings to UTF8. Input encodings vary, and I have quite good input encodings detection in place. I am using Iconv library wrapper to conver…

---

## [Spam](https://www.ruby-forum.com/t/spam/149767)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 10\
**Last updated:** [September 30, 2008, 6:33pm UTC](https://www.ruby-forum.com/t/spam/149767 "2008-09-30T18:33:36Z")

</div>

We need to do something about the SPAM coming through on Usenet. Question: Is Usenet support necessary any longer? I’ve heard multiple reports of it being dropped by ISPs. – I really know very little about the subject…

---

## [Ruby-GNOME2 0.18.0](https://www.ruby-forum.com/t/ruby-gnome2-0-18-0/149872)

<div class="topic-metadata">

**Author:** [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Replies:** 0\
**Last updated:** [September 30, 2008, 6:13pm UTC](https://www.ruby-forum.com/t/ruby-gnome2-0-18-0/149872 "2008-09-30T18:13:34Z")

</div>

Hi, The Ruby-GNOME2 project project has been released Ruby-GNOME2 0.18.0: Ruby-GNOME 2 - Browse Files at SourceForge.net Enjoy! == Highlights Fix memory leak bugs. Add xperimental packages: Ruby/GtkSourceView2 Ru…

---

## [Rest-client get header only](https://www.ruby-forum.com/t/rest-client-get-header-only/149842)

<div class="topic-metadata">

**Author:** [@klancaster](https://www.ruby-forum.com/u/klancaster)\
**Replies:** 3\
**Last updated:** [September 30, 2008, 6:03pm UTC](https://www.ruby-forum.com/t/rest-client-get-header-only/149842 "2008-09-30T18:03:26Z")

</div>

Hi, using the great rest-client from Adam W., but I can’t seam to be able work out how to get just the HEAD of a URL. i.e. in curl I would : curl -I URL I’m getting the data just fine with: return\_data = RestClient.g…

---

## [Good docs & tutorials for ruby cairo?](https://www.ruby-forum.com/t/good-docs-tutorials-for-ruby-cairo/149212)

<div class="topic-metadata">

**Author:** [@kyle\_s](https://www.ruby-forum.com/u/kyle_s)\
**Replies:** 5\
**Last updated:** [September 30, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/good-docs-tutorials-for-ruby-cairo/149212 "2008-09-30T17:10:04Z")

</div>

Are there good documents and tutorials for ruby cairo? I’ve run across a few samples, but they aren’t exactly flush with detail. There seems to be a number of programs written in ruby using cairo, but not much in the…

---

## [Extend keyword in class definition](https://www.ruby-forum.com/t/extend-keyword-in-class-definition/149830)

<div class="topic-metadata">

**Author:** [@ruud\_grosmann](https://www.ruby-forum.com/u/ruud_grosmann)\
**Replies:** 12\
**Last updated:** [September 30, 2008, 1:33pm UTC](https://www.ruby-forum.com/t/extend-keyword-in-class-definition/149830 "2008-09-30T13:33:18Z")

</div>

Hi list, I am reading the book ‘design patterns in ruby’. On page 201 I find this code example: require ‘forwardable’ class WriterDecorator extend Forwardable def\_delegators :@real\_writer, :write\_line, :rewind, :po…

---

## [Way to intercept method calls? - Reopened](https://www.ruby-forum.com/t/way-to-intercept-method-calls-reopened/149801)

<div class="topic-metadata">

**Author:** [@bct](https://www.ruby-forum.com/u/bct)\
**Replies:** 3\
**Last updated:** [September 30, 2008, 12:49pm UTC](https://www.ruby-forum.com/t/way-to-intercept-method-calls-reopened/149801 "2008-09-30T12:49:43Z")

</div>

Hello, I read the thread. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/676 Matz mentioned that he does not think its “worthy” which I interpret to mean there is either no use case or the use case is not…

---

## [Trunk & llvm-gcc 4.2](https://www.ruby-forum.com/t/trunk-llvm-gcc-4-2/149834)

<div class="topic-metadata">

**Author:** [@keltia](https://www.ruby-forum.com/u/keltia)\
**Replies:** 0\
**Last updated:** [September 30, 2008, 12:27pm UTC](https://www.ruby-forum.com/t/trunk-llvm-gcc-4-2/149834 "2008-09-30T12:27:08Z")

</div>

Hello, I’ve been trying to compile ruby 1.9/trunk with llvm for some time (llvm-gcc 4.2 as shipped by Apple in XCode 3.1.1) and always hit the same problem. During the compilation, first time miniruby tries to run, …

---

## [Copy remote a file](https://www.ruby-forum.com/t/copy-remote-a-file/149823)

<div class="topic-metadata">

**Author:** [@mihai](https://www.ruby-forum.com/u/mihai)\
**Replies:** 4\
**Last updated:** [September 30, 2008, 11:29am UTC](https://www.ruby-forum.com/t/copy-remote-a-file/149823 "2008-09-30T11:29:50Z")

</div>

How can i copy with ruby a file from my computer to another computer from lan? I have the administrator password of that computer.

---

## [Little help with autotest required please](https://www.ruby-forum.com/t/little-help-with-autotest-required-please/149829)

<div class="topic-metadata">

**Author:** [@Zouplaz](https://www.ruby-forum.com/u/Zouplaz)\
**Replies:** 0\
**Last updated:** [September 30, 2008, 11:15am UTC](https://www.ruby-forum.com/t/little-help-with-autotest-required-please/149829 "2008-09-30T11:15:43Z")

</div>

Hello, I’ve pulled my hairs hours long but I had no success with Autotest hooks… The test file is in test/scraping/something\_test.rb The library file is in lib/scaping/something.rb Created a .autotest file in my p…

---

## [\[Feature:1.9\] name referencing in sprintf](https://www.ruby-forum.com/t/feature-1-9-name-referencing-in-sprintf/145931)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 5\
**Last updated:** [September 30, 2008, 10:07am UTC](https://www.ruby-forum.com/t/feature-1-9-name-referencing-in-sprintf/145931 "2008-09-30T10:07:38Z")

</div>

e$B1sF#$G$9!#e(B 1.9 e$B$G$O@55,I=8=$GL\>A0$r;H$C$?;2\>H$,$G$-$k$N$G!"e(Bsprintf e$B$G$be(B e$BL\>A0$r;H$C$?;2\>H$,$G$-$k$HJXMx$8$c$J$$$G$7$g$&$+!#e(B $ ./ruby -e ‘puts “%d : %f” % { :foo =\> 1, :bar =\> 2 }’ 1 : 2.000000 …

---

## [\[Bug #611\] loop { BEGIN {} } dumps core](https://www.ruby-forum.com/t/bug-611-loop-begin-dumps-core/149822)

<div class="topic-metadata">

**Author:** [@Shyouhei\_U](https://www.ruby-forum.com/u/Shyouhei_U)\
**Replies:** 1\
**Last updated:** [September 30, 2008, 9:58am UTC](https://www.ruby-forum.com/t/bug-611-loop-begin-dumps-core/149822 "2008-09-30T09:58:15Z")

</div>

Bug #611: loop { BEGIN {} } dumps core http://redmine.ruby-lang.org/issues/show/611 e$B5/I\<\<Te(B: Shyouhei U. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: core e$B\<!$N$h$&$K$9$k$He(B core e$B$rEG$-$^…

---

## [Using Perl modules](https://www.ruby-forum.com/t/using-perl-modules/149718)

<div class="topic-metadata">

**Author:** [@rbjl](https://www.ruby-forum.com/u/rbjl)\
**Replies:** 10\
**Last updated:** [September 30, 2008, 9:49am UTC](https://www.ruby-forum.com/t/using-perl-modules/149718 "2008-09-30T09:49:59Z")

</div>

Hello, since there are a lot of perl modules out there, I wonder if someone has tried to use perl modules / functions in Ruby recently. Googling reveals some rather outdated approaches (eg http://www.yoshidam.net/per…

---

## [Gem install mysql](https://www.ruby-forum.com/t/gem-install-mysql/149776)

<div class="topic-metadata">

**Author:** [@reddvinylene](https://www.ruby-forum.com/u/reddvinylene)\
**Replies:** 2\
**Last updated:** [September 30, 2008, 8:42am UTC](https://www.ruby-forum.com/t/gem-install-mysql/149776 "2008-09-30T08:42:35Z")

</div>

I’m having some problems installing the MySQL Ruby gem here on Cygwin. Anybody know what’s up? $ uname -a CYGWIN\_NT-5.1 papaia 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin $ gem install mysql Building native exten…

---

## [$B2Pme=wO:\<+Bp(Blive$B=((B](https://www.ruby-forum.com/t/b2pme-wo-bp-blive-b-b/149817)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [September 30, 2008, 8:17am UTC](https://www.ruby-forum.com/t/b2pme-wo-bp-blive-b-b/149817 "2008-09-30T08:17:54Z")

</div>

av http://av1.qk176.com ave$B=wM%e(B http://av2.qk176.com e$BF|K\\e(Bav http://av3.qk176.com/ e$BF|K\\e(Bave$B=wM%e(B http://av4.qk176.com e$B?'\>pe(Bav http://av5.qk176.com/ ave$B2\<:\\e(B http://av6.qk176.com/ e…

---

## [Screen capture to display it or to save it to a file possible?](https://www.ruby-forum.com/t/screen-capture-to-display-it-or-to-save-it-to-a-file-possible/149711)

<div class="topic-metadata">

**Author:** [@liketofindoutwhy](https://www.ruby-forum.com/u/liketofindoutwhy)\
**Replies:** 4\
**Last updated:** [September 30, 2008, 7:45am UTC](https://www.ruby-forum.com/t/screen-capture-to-display-it-or-to-save-it-to-a-file-possible/149711 "2008-09-30T07:45:03Z")

</div>

i would like do screen capture and then to display it in that app’s window, or be able to save the file in hard disk as a GIF or PNG. I wonder if TCL Ruby or RMagick can already do that? Thanks.

---

## [Underscoming a class](https://www.ruby-forum.com/t/underscoming-a-class/149813)

<div class="topic-metadata">

**Author:** [@hangingclowns](https://www.ruby-forum.com/u/hangingclowns)\
**Replies:** 2\
**Last updated:** [September 30, 2008, 6:23am UTC](https://www.ruby-forum.com/t/underscoming-a-class/149813 "2008-09-30T06:23:45Z")

</div>

If I have a String like “DistributionMethod” is there any helper out there that will turn it into “distribution\_method” ?

---

## [Accessing a YAML loaded object without the object's definition?](https://www.ruby-forum.com/t/accessing-a-yaml-loaded-object-without-the-objects-definition/226027)

<div class="topic-metadata">

**Author:** [@spiz](https://www.ruby-forum.com/u/spiz)\
**Replies:** 1\
**Last updated:** [September 29, 2008, 10:25pm UTC](https://www.ruby-forum.com/t/accessing-a-yaml-loaded-object-without-the-objects-definition/226027 "2008-09-29T22:25:26Z")

</div>

Hi all, In Ruby, I have a fairly complex nested object structure that I serialize to a yaml file. Then, in another program, I read it into a varaible like this: obj = YAML::load\_file(“myfile.yaml”); I can see all o…

---

## [Code Review: ArrayInit](https://www.ruby-forum.com/t/code-review-arrayinit/149794)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 1\
**Last updated:** [September 29, 2008, 10:18pm UTC](https://www.ruby-forum.com/t/code-review-arrayinit/149794 "2008-09-29T22:18:59Z")

</div>

tfpt review “/shelveset:ArrayInit;REDMOND\\tomat” Fixes array initializers. Tomas

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

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