# Ruby

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

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

---

## [\[Feature:trunk\] Vector#/](https://www.ruby-forum.com/t/feature-trunk-vector/182241)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 2\
**Last updated:** [January 27, 2010, 3:38pm UTC](https://www.ruby-forum.com/t/feature-trunk-vector/182241 "2010-01-27T15:38:33Z")

</div>

e$B1sF#$G$9!#e(B Matrix#/ e$B$de(B Vector#\* e$B$,$"$k$N$Ge(B Vector#/ e$B$b$"$C$F$$$$$H;W$$$^$9!#e(B — a/lib/matrix.rb +++ b/lib/matrix.rb @@ -1258,6 +1255,20 @@ class Vector end end Vector division. def…

---

## [\[Bug:trunk\] Vector can't be coerced into Vector](https://www.ruby-forum.com/t/bug-trunk-vector-cant-be-coerced-into-vector/182240)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 3\
**Last updated:** [January 27, 2010, 3:38pm UTC](https://www.ruby-forum.com/t/bug-trunk-vector-cant-be-coerced-into-vector/182240 "2010-01-27T15:38:33Z")

</div>

e$B1sF#$G$9!#e(B Vector e$B$Ke(B Vector e$B$r$+$1$k$He(B Vector can’t be coerced into Vector e$B$H$$$&e(B e$BNc30$,=P$^$9!#e(B $ ./ruby -rmatrix -e ‘Vector\[1, 2, 3\] \* Vector\[4, 5, 6\]’ /home/mame/work/ruby/lib/ruby/1…

---

## [Fast string compression and uncompression](https://www.ruby-forum.com/t/fast-string-compression-and-uncompression/182400)

<div class="topic-metadata">

**Author:** [@m94asr](https://www.ruby-forum.com/u/m94asr)\
**Replies:** 0\
**Last updated:** [January 27, 2010, 3:36pm UTC](https://www.ruby-forum.com/t/fast-string-compression-and-uncompression/182400 "2010-01-27T15:36:12Z")

</div>

Hi all, I am looking for a fast string compression/uncompression on small strings (max 2 kb). zlib works well, but is too slow for my application; I would happily tradeoff a bit of compression for more speed; Does an…

---

## [Being confused about libraries](https://www.ruby-forum.com/t/being-confused-about-libraries/182393)

<div class="topic-metadata">

**Author:** [@rubynut](https://www.ruby-forum.com/u/rubynut)\
**Replies:** 7\
**Last updated:** [January 27, 2010, 3:20pm UTC](https://www.ruby-forum.com/t/being-confused-about-libraries/182393 "2010-01-27T15:20:23Z")

</div>

Hello, When running gem I always need to add this lib and that lib (I’m using an ubuntu desktop linux). For example, for sqlite3, sometime I installed it: gem install sqlite3-ruby While some other time I installed i…

---

## [Dynamically set named\_scope based on current\_user](https://www.ruby-forum.com/t/dynamically-set-named-scope-based-on-current-user/182354)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 4\
**Last updated:** [January 27, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/dynamically-set-named-scope-based-on-current-user/182354 "2010-01-27T14:59:22Z")

</div>

Hey all, I keep getting the following error: You have a nil object when you didn’t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.size Based on the current user, whe…

---

## [Build an array using data from an exisiting array](https://www.ruby-forum.com/t/build-an-array-using-data-from-an-exisiting-array/182368)

<div class="topic-metadata">

**Author:** [@seanwarburton](https://www.ruby-forum.com/u/seanwarburton)\
**Replies:** 6\
**Last updated:** [January 27, 2010, 2:50pm UTC](https://www.ruby-forum.com/t/build-an-array-using-data-from-an-exisiting-array/182368 "2010-01-27T14:50:14Z")

</div>

I’m buiding a script at the moment and part of it receives a trigger via Telnet to say send me an XML request for one of five random items. Sending the request is time critical, so the faster the better and what I do …

---

## [Circular require warning is emitted to both stdout and stderr](https://www.ruby-forum.com/t/circular-require-warning-is-emitted-to-both-stdout-and-stderr/182235)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 2\
**Last updated:** [January 27, 2010, 2:35pm UTC](https://www.ruby-forum.com/t/circular-require-warning-is-emitted-to-both-stdout-and-stderr/182235 "2010-01-27T14:35:54Z")

</div>

e$B1sF#$G$9!#e(B $ ./ruby -w foo.rb /home/mame/work/ruby/foo.rb:1: warning: loading in progress, circular require considered harmful - /home/mame/work/ruby/bar.rb from foo.rb:1:in \<main\>' from foo.rb:1:inrequire’ fr…

---

## [Install/Update scripts in ruby gems](https://www.ruby-forum.com/t/install-update-scripts-in-ruby-gems/182395)

<div class="topic-metadata">

**Author:** [@fatnack](https://www.ruby-forum.com/u/fatnack)\
**Replies:** 0\
**Last updated:** [January 27, 2010, 2:27pm UTC](https://www.ruby-forum.com/t/install-update-scripts-in-ruby-gems/182395 "2010-01-27T14:27:48Z")

</div>

Hello There I’d like to create a ruby gem package (currently using newgem) which works as a linux tool. It’s configuration should be located in /etc/ and so on. So I need to include a setup-script into the gem, which …

---

## [Installing Ruby Application](https://www.ruby-forum.com/t/installing-ruby-application/182321)

<div class="topic-metadata">

**Author:** [@tony44](https://www.ruby-forum.com/u/tony44)\
**Replies:** 6\
**Last updated:** [January 27, 2010, 1:35pm UTC](https://www.ruby-forum.com/t/installing-ruby-application/182321 "2010-01-27T13:35:01Z")

</div>

What’s the best way to install a Ruby (non-rails) application? So far I’ve built and written a launchable gem on my Mac. There’s a script, /lib/appname.rb that does everything. When I install the gem (which works like…

---

## [How to use WIN32OLE to Save As PDF](https://www.ruby-forum.com/t/how-to-use-win32ole-to-save-as-pdf/182117)

<div class="topic-metadata">

**Author:** [@joep](https://www.ruby-forum.com/u/joep)\
**Replies:** 11\
**Last updated:** [January 27, 2010, 12:11pm UTC](https://www.ruby-forum.com/t/how-to-use-win32ole-to-save-as-pdf/182117 "2010-01-27T12:11:54Z")

</div>

Hi, I’ve been trying to figure out how to use Win32OLE to save as a PDF. It doesn’t seem like there’s any good documentation on how to do this, so I was hoping someone here has experience with this. Anyhoo, if anyon…

---

## [Best practices when writing destructive code](https://www.ruby-forum.com/t/best-practices-when-writing-destructive-code/181939)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 9\
**Last updated:** [January 27, 2010, 11:26am UTC](https://www.ruby-forum.com/t/best-practices-when-writing-destructive-code/181939 "2010-01-27T11:26:13Z")

</div>

Im going to be making and removing lots of directories using ruby and Im feeling a bit uneasy about it. One of my fears is that a potential typo after refactoring, cutting and pasting etc could cause my program to del…

---

## [Jruby assumes rubygems](https://www.ruby-forum.com/t/jruby-assumes-rubygems/182367)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 1\
**Last updated:** [January 27, 2010, 10:08am UTC](https://www.ruby-forum.com/t/jruby-assumes-rubygems/182367 "2010-01-27T10:08:22Z")

</div>

this from a github clone, ubuntu rdp@ubuntu910:~/dev/downloads/jruby$ rake --trace (in /home/rdp/dev/downloads/jruby) rake aborted! undefined method gem' for main:Object /home/rdp/dev/downloads/jruby/rakelib/test.rak…

---

## [Contributing to IronRuby on \*nix](https://www.ruby-forum.com/t/contributing-to-ironruby-on-nix/182340)

<div class="topic-metadata">

**Author:** [@CSKSPonnappa](https://www.ruby-forum.com/u/CSKSPonnappa)\
**Replies:** 4\
**Last updated:** [January 27, 2010, 9:53am UTC](https://www.ruby-forum.com/t/contributing-to-ironruby-on-nix/182340 "2010-01-27T09:53:08Z")

</div>

Hello everyone, Recently I’ve been trying develop a gem with native extensions in C, Java and C# just to learn what’s involved. When working with IronRuby, I ran into a few small issues so I figured I’d learn how to b…

---

## [Three bugs of Matrix::Scalar](https://www.ruby-forum.com/t/three-bugs-of-matrix-scalar/182242)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 1\
**Last updated:** [January 27, 2010, 9:28am UTC](https://www.ruby-forum.com/t/three-bugs-of-matrix-scalar/182242 "2010-01-27T09:28:33Z")

</div>

e$B1sF#$G$9!#e(B Matrix::Scalar e$B$NDj5A$Ke(B 3 e$B$D$\*$+$7$$$H$3$m$r8+$D$1$^$7$?!#e(B nodoc e$B$J%/%i%9$G$9$,!"$I$l$bC1=c$JLdBj$@$H;W$&$N$GJs9p$7$^$9!#e(B e$B!{e(B WrongArgType e$B$,L$Dj5Ae(B $ ./ruby -rmatrix -e ‘…

---

## [Problems with Telnet](https://www.ruby-forum.com/t/problems-with-telnet/182151)

<div class="topic-metadata">

**Author:** [@seanwarburton](https://www.ruby-forum.com/u/seanwarburton)\
**Replies:** 5\
**Last updated:** [January 27, 2010, 8:40am UTC](https://www.ruby-forum.com/t/problems-with-telnet/182151 "2010-01-27T08:40:49Z")

</div>

Firstly I’m a total newbie not just to Ruby but programming full stop so go gentle, please :slight\_smile: I’m looking for some help with a telnet problem. I am using a service that uses telnet to let you check the reg…

---

## [Rubygems-sing 1.1.0 Released](https://www.ruby-forum.com/t/rubygems-sing-1-1-0-released/182376)

<div class="topic-metadata">

**Author:** [@aguynamedryan](https://www.ruby-forum.com/u/aguynamedryan)\
**Replies:** 0\
**Last updated:** [January 27, 2010, 7:22am UTC](https://www.ruby-forum.com/t/rubygems-sing-1-1-0-released/182376 "2010-01-27T07:22:44Z")

</div>

rubygems-sing version 1.1.0 has been released! http://rubyforge.org/projects/seattlerb “Sings” a gem’s implementation. Changes: 1.1.0 / 2010-01-26 1 minor enhancement: Added blues scale and duration based on di…

---

## [\[Bug #2648\] Mac OS X 10.6/10.5$B$G(B--enable-pthread$B$N$H$-(Btest-all$B$G(BSEGV$B$9$k(B](https://www.ruby-forum.com/t/bug-2648-mac-os-x-10-6-10-5-b-g-b-enable-pthread-b-n-h-btest-all-b-g-bsegv-b-9-k-b/182229)

<div class="topic-metadata">

**Author:** [@Wataru\_Kimura](https://www.ruby-forum.com/u/Wataru_Kimura)\
**Replies:** 3\
**Last updated:** [January 27, 2010, 6:17am UTC](https://www.ruby-forum.com/t/bug-2648-mac-os-x-10-6-10-5-b-g-b-enable-pthread-b-n-h-btest-all-b-g-bsegv-b-9-k-b/182229 "2010-01-27T06:17:47Z")

</div>

Bug #2648: Mac OS X 10.6/10.5e$B$Ge(B–enable-pthreade$B$N$H$-e(Btest-alle$B$Ge(BSEGVe$B$9$ke(B http://redmine.ruby-lang.org/issues/show/2648 e$B5/I\<\<Te(B: Wataru Kimura e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal r…

---

## [Is there a way to have instance\_eval cannot call private/protected method?](https://www.ruby-forum.com/t/is-there-a-way-to-have-instance-eval-cannot-call-private-protected-method/182296)

<div class="topic-metadata">

**Author:** [@slowhog](https://www.ruby-forum.com/u/slowhog)\
**Replies:** 2\
**Last updated:** [January 27, 2010, 2:55am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-have-instance-eval-cannot-call-private-protected-method/182296 "2010-01-27T02:55:53Z")

</div>

Hi, Is there any mechanism to do what instance\_eval but honor the visibility? I want to something like following, but would like the block passed to real\_object can only only have access to public methods. I did a l…

---

## [Gsub problem](https://www.ruby-forum.com/t/gsub-problem/182251)

<div class="topic-metadata">

**Author:** [@lalawawa](https://www.ruby-forum.com/u/lalawawa)\
**Replies:** 6\
**Last updated:** [January 27, 2010, 2:05am UTC](https://www.ruby-forum.com/t/gsub-problem/182251 "2010-01-27T02:05:33Z")

</div>

I’m trying to use gsub to put escapes before single quotes. irb(main):001:0\> a = “Ain’t Can’t” =\> “Ain’t Can’t” irb(main):002:0\> a.gsub(/(’)/, ‘\\1’) =\> “Ain’t Can’t” irb(main):003:0\> a.gsub(/(’)/, ‘\\\\1’) =\> “Ain\\1t…

---

## [Why does Regexp::escape backslash spaces?!?](https://www.ruby-forum.com/t/why-does-regexp-escape-backslash-spaces/182349)

<div class="topic-metadata">

**Author:** [@marnen](https://www.ruby-forum.com/u/marnen)\
**Replies:** 3\
**Last updated:** [January 26, 2010, 11:16pm UTC](https://www.ruby-forum.com/t/why-does-regexp-escape-backslash-spaces/182349 "2010-01-26T23:16:54Z")

</div>

$ ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) \[universal-darwin10.0\] $ irb irb(main):001:0\> Regexp::escape(‘a b’) =\> “a\\ b” Why? This doesn’t seem to make any sense. Is it a bug? Best, Marnen Laibow-Koser htt…

---

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

<div class="topic-metadata">

**Author:** [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Replies:** 2\
**Last updated:** [January 26, 2010, 10:52pm UTC](https://www.ruby-forum.com/t/code-review-eaccess/182352 "2010-01-26T22:52:51Z")

</div>

tfpt review “/shelveset:eaccess;REDMOND\\sborde” Comment : Dir.mkdir should raise Errno::EACCESS instead of System.UnauthorizedException Diables ActiveRecord tests since some fail intermittently

---

## [Hard hang, 1.8.7 build 248. May be threading related](https://www.ruby-forum.com/t/hard-hang-1-8-7-build-248-may-be-threading-related/182283)

<div class="topic-metadata">

**Author:** [@waynefchin](https://www.ruby-forum.com/u/waynefchin)\
**Replies:** 1\
**Last updated:** [January 26, 2010, 10:51pm UTC](https://www.ruby-forum.com/t/hard-hang-1-8-7-build-248-may-be-threading-related/182283 "2010-01-26T22:51:27Z")

</div>

I’ve got a little piece of code that can hang Ruby 1.8.7 patchlevel 248 about one out of every 500 times it is run. Here is foo.rb: #!/usr/bin/ruby1.8 # The puts is not necessary to reproduce the problem. It just ma…

---

## [Can't find libxml-ruby gem](https://www.ruby-forum.com/t/cant-find-libxml-ruby-gem/180775)

<div class="topic-metadata">

**Author:** [@peralta](https://www.ruby-forum.com/u/peralta)\
**Replies:** 4\
**Last updated:** [January 26, 2010, 10:22pm UTC](https://www.ruby-forum.com/t/cant-find-libxml-ruby-gem/180775 "2010-01-26T22:22:42Z")

</div>

I am unable to find a libxml-ruby gem. I’ve pasted some diagnostic info below. Could someone please point me in the right direction? Thank you. C:\>irb irb(main):001:0\> require ‘libxml-ruby’ LoadError: no such file …

---

## [Find the parameters of each method in a class](https://www.ruby-forum.com/t/find-the-parameters-of-each-method-in-a-class/182345)

<div class="topic-metadata">

**Author:** [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Replies:** 6\
**Last updated:** [January 26, 2010, 10:21pm UTC](https://www.ruby-forum.com/t/find-the-parameters-of-each-method-in-a-class/182345 "2010-01-26T22:21:43Z")

</div>

Is there a way to find the parameters of each method in a class? For instance I have a class like: class CoolClass def meth\_one(p1,p2) … end def meth\_two(p1,p2,p3) … end end I can run: cc = CoolClass.new cc.p…

---

## [Why is the Binding object so useless?](https://www.ruby-forum.com/t/why-is-the-binding-object-so-useless/182272)

<div class="topic-metadata">

**Author:** [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Replies:** 3\
**Last updated:** [January 26, 2010, 8:11pm UTC](https://www.ruby-forum.com/t/why-is-the-binding-object-so-useless/182272 "2010-01-26T20:11:45Z")

</div>

I am used to Ruby being a rather reflective language that gives carte blanche to the programmer. So I found this rather surprising: Marshal.dump binding TypeError: no marshal\_dump is defined for class Binding Wh…

---

## [Build a hash from ARGV, the Ruby way](https://www.ruby-forum.com/t/build-a-hash-from-argv-the-ruby-way/182281)

<div class="topic-metadata">

**Author:** [@tobyr](https://www.ruby-forum.com/u/tobyr)\
**Replies:** 4\
**Last updated:** [January 26, 2010, 7:09pm UTC](https://www.ruby-forum.com/t/build-a-hash-from-argv-the-ruby-way/182281 "2010-01-26T19:09:06Z")

</div>

I would like to build a hash from ARGV using UNIX type notation ie any argument which begins with a hyphen or double hyphen is an option and may have as value(s) the argument(s) which succeed it (if they don’t have hy…

---

## [Using ActiveRecord in subclasses](https://www.ruby-forum.com/t/using-activerecord-in-subclasses/182335)

<div class="topic-metadata">

**Author:** [@paul-au](https://www.ruby-forum.com/u/paul-au)\
**Replies:** 1\
**Last updated:** [January 26, 2010, 6:52pm UTC](https://www.ruby-forum.com/t/using-activerecord-in-subclasses/182335 "2010-01-26T18:52:40Z")

</div>

Hi, I’m using ActiveRecord and ActiveSupport in a non-rails environment to connect to multiple databases, and I’ve found the following (single database) to cause me an error. Note that params is my database settings a…

---

## [\[Bug #2661\] Bignum \<= BigDecimal("NaN") raises an Exception](https://www.ruby-forum.com/t/bug-2661-bignum-bigdecimal-nan-raises-an-exception/182332)

<div class="topic-metadata">

**Author:** [@Yusuke\_E](https://www.ruby-forum.com/u/Yusuke_E)\
**Replies:** 0\
**Last updated:** [January 26, 2010, 5:31pm UTC](https://www.ruby-forum.com/t/bug-2661-bignum-bigdecimal-nan-raises-an-exception/182332 "2010-01-26T17:31:19Z")

</div>

Bug #2661: Bignum \<= BigDecimal(“NaN”) raises an Exception http://redmine.ruby-lang.org/issues/show/2661 e$B5/I\<\<Te(B: Yusuke E. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: core ruby -v: ruby 1.9.2d…

---

## [Johnson 1.2.0 Released](https://www.ruby-forum.com/t/johnson-1-2-0-released/182275)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 3\
**Last updated:** [January 26, 2010, 5:24pm UTC](https://www.ruby-forum.com/t/johnson-1-2-0-released/182275 "2010-01-26T17:24:18Z")

</div>

johnson version 1.2.0 has been released! http://github.com/jbarnette/johnson http://groups.google.com/group/johnson-talk Johnson wraps JavaScript in a loving Ruby embrace. It embeds the Mozilla SpiderMonkey JavaScrip…

---

## [Sup 0.10 released](https://www.ruby-forum.com/t/sup-0-10-released/182185)

<div class="topic-metadata">

**Author:** [@trucker](https://www.ruby-forum.com/u/trucker)\
**Replies:** 8\
**Last updated:** [January 26, 2010, 4:05pm UTC](https://www.ruby-forum.com/t/sup-0-10-released/182185 "2010-01-26T16:05:52Z")

</div>

I’m pleased to announce the release of Sup 0.10. This version is frickin’ awesome because not only do we have Ruby 1.9 support, the Xapian backend is now the default! The next version will discard Ferret like a used …

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

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