# Ruby

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

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

---

## [Some help with threads](https://www.ruby-forum.com/t/some-help-with-threads/187564)

<div class="topic-metadata">

**Author:** [@noob2everything](https://www.ruby-forum.com/u/noob2everything)\
**Replies:** 4\
**Last updated:** [April 26, 2010, 6:07pm UTC](https://www.ruby-forum.com/t/some-help-with-threads/187564 "2010-04-26T18:07:40Z")

</div>

Hi, I am using threads to do some calculations and I would like some help. I have a function named “myfun(i,k)” which creates within its body some arrays and does a bunch of stuff with them and returns an integer. T…

---

## [RubyGems/RDoc 1.8.6 policy](https://www.ruby-forum.com/t/rubygems-rdoc-1-8-6-policy/187509)

<div class="topic-metadata">

**Author:** [@Zac\_Brown](https://www.ruby-forum.com/u/Zac_Brown)\
**Replies:** 5\
**Last updated:** [April 26, 2010, 5:56pm UTC](https://www.ruby-forum.com/t/rubygems-rdoc-1-8-6-policy/187509 "2010-04-26T17:56:32Z")

</div>

Saw this earlier today, might be something to think about in the near future for IronRuby and compatibility. http://blog.segment7.net/articles/2010/04/23/ruby-1-8-6-policy -Zac

---

## [Ruby networking: Errno::ECONNREFUSED: Connection refused - connect(2) on Ubuntu 9.1](https://www.ruby-forum.com/t/ruby-networking-errno-connection-refused-connect-2-on-ubuntu-9-1/187598)

<div class="topic-metadata">

**Author:** [@Bill\_McLean](https://www.ruby-forum.com/u/Bill_McLean)\
**Replies:** 4\
**Last updated:** [April 26, 2010, 5:26pm UTC](https://www.ruby-forum.com/t/ruby-networking-errno-connection-refused-connect-2-on-ubuntu-9-1/187598 "2010-04-26T17:26:06Z")

</div>

All, When using the Ruby networking library in two sample programs below I get the connect refused exception. To validate the code, I am running both the client and server code in separate terminal windows. The ip…

---

## [\[ANN\] DrX, an object inspector](https://www.ruby-forum.com/t/ann-drx-an-object-inspector/187225)

<div class="topic-metadata">

**Author:** [@mooffie](https://www.ruby-forum.com/u/mooffie)\
**Replies:** 31\
**Last updated:** [April 26, 2010, 5:07pm UTC](https://www.ruby-forum.com/t/ann-drx-an-object-inspector/187225 "2010-04-26T17:07:21Z")

</div>

DrX is an object inspector (and a source-code browser). See screenshots at its homepage: http://drx.rubyforge.org I hope it isn’t considered bad manners to publish it here. My little gem exists for over a year but I …

---

## [Why did #rationalize removed?](https://www.ruby-forum.com/t/why-did-rationalize-removed/187589)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 4\
**Last updated:** [April 26, 2010, 3:44pm UTC](https://www.ruby-forum.com/t/why-did-rationalize-removed/187589 "2010-04-26T15:44:12Z")

</div>

e$B$U$J$P$5$se(B e$B1sF#$G$9!#e(B Rational#rationalize e$B$r;O$a!"B?$/$Ne(B #rationalize e$B%a%=%C%I$,:o=|e(B e$B$5$l$?$h$&$G$9$,!“2?$+M}M3$,$”$C$F$N$3$H$G$7$g$&$+!#e(B e$B$9$G$Ke(B feature freeze e$B:Q$$G$"$k$?$a!…

---

## [Did 1.9 deprecate NUM2INT?](https://www.ruby-forum.com/t/did-1-9-deprecate-num2int/187562)

<div class="topic-metadata">

**Author:** [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Replies:** 4\
**Last updated:** [April 26, 2010, 9:50am UTC](https://www.ruby-forum.com/t/did-1-9-deprecate-num2int/187562 "2010-04-26T09:50:03Z")

</div>

I just upgraded to 1.9 and now my extension won’t compile, complaining that: error: 'NUM2INT' was not declared in this scope Did 1.9 deprecate NUM2INT? What should I use instead? Or has something else gone …

---

## [\[ANN\] Ember 0.2.0](https://www.ruby-forum.com/t/ann-ember-0-2-0/187580)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [April 26, 2010, 7:45am UTC](https://www.ruby-forum.com/t/ann-ember-0-2-0/187580 "2010-04-26T07:45:17Z")

</div>

Ember eRuby template processor http://snk.tuxfamily.org/lib/ember/ Ember (EMBEdded Ruby) is an \[1\]eRuby template processor that allows debugging, reduces markup…

---

## [Jruby\_gc\_stats 0.1: a set of GC monitoring methods similar to REE](https://www.ruby-forum.com/t/jruby-gc-stats-0-1-a-set-of-gc-monitoring-methods-similar-to-ree/187572)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 0\
**Last updated:** [April 26, 2010, 4:22am UTC](https://www.ruby-forum.com/t/jruby-gc-stats-0-1-a-set-of-gc-monitoring-methods-similar-to-ree/187572 "2010-04-26T04:22:17Z")

</div>

Hiya! I just released a gem called jruby\_gc\_stats, which provides for JRuby most of the GC-monitoring methods users of Ruby Enterprise Edition might be using. These methods are provided without any performance impact …

---

## [\[ANN\] Inochi 2.0.1](https://www.ruby-forum.com/t/ann-inochi-2-0-1/187567)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [April 26, 2010, 2:24am UTC](https://www.ruby-forum.com/t/ann-inochi-2-0-1/187567 "2010-04-26T02:24:56Z")

</div>

Inochi Gives life to Ruby projects http://snk.tuxfamily.org/lib/inochi/ Inochi is an infrastructure for Ruby projects that helps you test, document, package, publi…

---

## [Ruby 1.91.376 hangs when launched with python pExpect](https://www.ruby-forum.com/t/ruby-1-91-376-hangs-when-launched-with-python-pexpect/187353)

<div class="topic-metadata">

**Author:** [@davidjrice](https://www.ruby-forum.com/u/davidjrice)\
**Replies:** 6\
**Last updated:** [April 25, 2010, 11:12pm UTC](https://www.ruby-forum.com/t/ruby-1-91-376-hangs-when-launched-with-python-pexpect/187353 "2010-04-25T23:12:05Z")

</div>

Hi I have a ruby program which has a UI using readline library. In the background it launches some ruby threads which serve as a tcp server. It works fine so far. But when it is launched on an automated way using pyt…

---

## [Metaprogramming - Array initialization](https://www.ruby-forum.com/t/metaprogramming-array-initialization/187527)

<div class="topic-metadata">

**Author:** [@judge](https://www.ruby-forum.com/u/judge)\
**Replies:** 7\
**Last updated:** [April 25, 2010, 10:48pm UTC](https://www.ruby-forum.com/t/metaprogramming-array-initialization/187527 "2010-04-25T22:48:05Z")

</div>

Hi, In Ruby, we can declare array as explain in the doc: http://ruby-doc.org/core/classes/Array.html#M002150 That makes possible many kind of use, such as: Array.new(1, Array.new(3, Array.new(2, Array.new(1)))) =\> …

---

## [Gem Path remove](https://www.ruby-forum.com/t/gem-path-remove/184489)

<div class="topic-metadata">

**Author:** [@brunik](https://www.ruby-forum.com/u/brunik)\
**Replies:** 3\
**Last updated:** [April 25, 2010, 10:15pm UTC](https://www.ruby-forum.com/t/gem-path-remove/184489 "2010-04-25T22:15:39Z")

</div>

Hello Everyone, I’m having trouble installing gems because of a gem path. C:\>gem install watir ERROR: While executing gem … (Errno::EACCES) Permission denied - Z:/.gem C:\>gem env RubyGems Environment: RUBYGEMS V…

---

## [Testing Rake tasks with RSpec... and Rake](https://www.ruby-forum.com/t/testing-rake-tasks-with-rspec-and-rake/187556)

<div class="topic-metadata">

**Author:** [@johnf](https://www.ruby-forum.com/u/johnf)\
**Replies:** 0\
**Last updated:** [April 25, 2010, 8:41pm UTC](https://www.ruby-forum.com/t/testing-rake-tasks-with-rspec-and-rake/187556 "2010-04-25T20:41:07Z")

</div>

I’m of the (perhaps misguided) opinion that since Rake tasks are Ruby code, they need to be tested. However, I’ve never done this before, but thought it was worth looking into. So I wrote a simple RSpec test: \[\[\[\[ ./t…

---

## [Wxruby install problem](https://www.ruby-forum.com/t/wxruby-install-problem/187546)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 3\
**Last updated:** [April 25, 2010, 3:04pm UTC](https://www.ruby-forum.com/t/wxruby-install-problem/187546 "2010-04-25T15:04:29Z")

</div>

pt@pt-laptop:~$ sudo gem install wxruby \[sudo\] password for pt: Successfully installed wxruby-2.0.1-x86-linux 1 gem installed Installing ri documentation for wxruby-2.0.1-x86-linux… Updating class cache with 2751 c…

---

## [\[Bug #3198\] O\_APPEND for redirect fd is ignored on windows](https://www.ruby-forum.com/t/bug-3198-o-append-for-redirect-fd-is-ignored-on-windows/187538)

<div class="topic-metadata">

**Author:** [@SSwanabe](https://www.ruby-forum.com/u/SSwanabe)\
**Replies:** 4\
**Last updated:** [April 25, 2010, 2:03pm UTC](https://www.ruby-forum.com/t/bug-3198-o-append-for-redirect-fd-is-ignored-on-windows/187538 "2010-04-25T14:03:06Z")

</div>

Bug #3198: O\_APPEND for redirect fd is ignored on windows http://redmine.ruby-lang.org/issues/show/3198 e$B5/I\<\<Te(B: \_ wanabe e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal ruby -v: ruby 1.9.2dev (2010-04-24 trunk 227…

---

## [Defining your own typecaster](https://www.ruby-forum.com/t/defining-your-own-typecaster/187531)

<div class="topic-metadata">

**Author:** [@jcain](https://www.ruby-forum.com/u/jcain)\
**Replies:** 4\
**Last updated:** [April 25, 2010, 12:42pm UTC](https://www.ruby-forum.com/t/defining-your-own-typecaster/187531 "2010-04-25T12:42:55Z")

</div>

Hi, how do you define your own typecaster? Builtin examples Array(1…5) # =\> \[1, 2, 3, 4, 5\] Integer(5.2) # =\> 5 Float(5) # =\> 5.0 I would expect it to be something like this class Foo def self.()(\*objs) F…

---

## [Rexml pretty printing "can't modify frozen string"](https://www.ruby-forum.com/t/rexml-pretty-printing-cant-modify-frozen-string/187542)

<div class="topic-metadata">

**Author:** [@Une\_BSSSSvue](https://www.ruby-forum.com/u/Une_BSSSSvue)\
**Replies:** 3\
**Last updated:** [April 25, 2010, 12:31pm UTC](https://www.ruby-forum.com/t/rexml-pretty-printing-cant-modify-frozen-string/187542 "2010-04-25T12:31:13Z")

</div>

i want to use (ruby 1.9) Formatters::Pretty and i get the error : /opt/local/lib/ruby1.9/1.9.1/rexml/formatters/pretty.rb:90:in \`squeeze!’: can’t modify frozen string (RuntimeError) then, i look if my strings are froz…

---

## [\#object\_hexid](https://www.ruby-forum.com/t/object-hexid/187514)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 8\
**Last updated:** [April 25, 2010, 9:52am UTC](https://www.ruby-forum.com/t/object-hexid/187514 "2010-04-25T09:52:35Z")

</div>

Can anyone write a reliable Kernel#object\_hexid, a method that returns an object’s id but in hex, just like Ruby’s normal #inspect provides. My attempts seems to break depending on the version of Ruby used.

---

## [Calling scala from JRuby](https://www.ruby-forum.com/t/calling-scala-from-jruby/187528)

<div class="topic-metadata">

**Author:** [@cast\_ent](https://www.ruby-forum.com/u/cast_ent)\
**Replies:** 1\
**Last updated:** [April 25, 2010, 6:02am UTC](https://www.ruby-forum.com/t/calling-scala-from-jruby/187528 "2010-04-25T06:02:01Z")

</div>

I’m interested in using JRuby as higher level interface for a bunch of scala code that I have … sort of a configuration management tool for a scala-based project. I’d like to be able to do rather simple things in JRub…

---

## [\[ANN\] Inochi 2.0.0](https://www.ruby-forum.com/t/ann-inochi-2-0-0/187533)

<div class="topic-metadata">

**Author:** [@snk](https://www.ruby-forum.com/u/snk)\
**Replies:** 0\
**Last updated:** [April 25, 2010, 2:34am UTC](https://www.ruby-forum.com/t/ann-inochi-2-0-0/187533 "2010-04-25T02:34:20Z")

</div>

Inochi Gives life to Ruby projects http://snk.tuxfamily.org/lib/inochi/ Inochi is an infrastructure for Ruby projects that helps you test, document, package, publi…

---

## [Best way to write this method?](https://www.ruby-forum.com/t/best-way-to-write-this-method/187397)

<div class="topic-metadata">

**Author:** [@derek](https://www.ruby-forum.com/u/derek)\
**Replies:** 12\
**Last updated:** [April 24, 2010, 9:53pm UTC](https://www.ruby-forum.com/t/best-way-to-write-this-method/187397 "2010-04-24T21:53:19Z")

</div>

Could my code below be more Ruby-esque or simpler (using Ruby methods I might not know)? def range\_overlaps?(a, b) array = a.to\_a & b.to\_a !array.empty? end def overlaps?(a, b) Check if days overlap; if not, no re…

---

## [Change to a newly created directory](https://www.ruby-forum.com/t/change-to-a-newly-created-directory/187430)

<div class="topic-metadata">

**Author:** [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Replies:** 3\
**Last updated:** [April 24, 2010, 9:08pm UTC](https://www.ruby-forum.com/t/change-to-a-newly-created-directory/187430 "2010-04-24T21:08:08Z")

</div>

Ruby Beginner I have a command line script that captures a single argument and creates a directory in that name. I then want to copy some directories inside of this newly created directory. I can’t seem to figure ou…

---

## [Installing Bundler on IronRuby](https://www.ruby-forum.com/t/installing-bundler-on-ironruby/187524)

<div class="topic-metadata">

**Author:** [@ryan](https://www.ruby-forum.com/u/ryan)\
**Replies:** 0\
**Last updated:** [April 24, 2010, 8:56pm UTC](https://www.ruby-forum.com/t/installing-bundler-on-ironruby/187524 "2010-04-24T20:56:33Z")

</div>

When trying to install Bundler from source with IronRuby (since the RubyGems update seems to have lost the ability to do this), I received the following. I’ll try looking into this, but I wanted to post it just in ca…

---

## [Segmentation fault at raise exception](https://www.ruby-forum.com/t/segmentation-fault-at-raise-exception/187518)

<div class="topic-metadata">

**Author:** [@o01eg](https://www.ruby-forum.com/u/o01eg)\
**Replies:** 12\
**Last updated:** [April 24, 2010, 8:32pm UTC](https://www.ruby-forum.com/t/segmentation-fault-at-raise-exception/187518 "2010-04-24T20:32:59Z")

</div>

I get segfault at any Ruby exception with C API: (gdb) bt #0 0x00007ffff58ebd78 in siglongjmp () from /lib/libc.so.6 #1 0x00007ffff719d3e7 in rb\_longjmp (tag=6, mesg=6652280) at eval.c:442 #2 0x00007ffff719d422 in…

---

## [Warble broken in jruby 1.5?](https://www.ruby-forum.com/t/warble-broken-in-jruby-1-5/187519)

<div class="topic-metadata">

**Author:** [@Tommy\_C](https://www.ruby-forum.com/u/Tommy_C)\
**Replies:** 3\
**Last updated:** [April 24, 2010, 8:10pm UTC](https://www.ruby-forum.com/t/warble-broken-in-jruby-1-5/187519 "2010-04-24T20:10:54Z")

</div>

installed jruby 1.5 a few days ago and im trying to use warble to run a test sinatra app on gae. $warble /Users/tcc/bin/jruby/bin/warble: line 9: require: command not found /Users/tcc/bin/jruby/bin/warble: line 11: v…

---

## [Missing dependence in Makefile](https://www.ruby-forum.com/t/missing-dependence-in-makefile/187520)

<div class="topic-metadata">

**Author:** [@o01eg](https://www.ruby-forum.com/u/o01eg)\
**Replies:** 0\
**Last updated:** [April 24, 2010, 6:09pm UTC](https://www.ruby-forum.com/t/missing-dependence-in-makefile/187520 "2010-04-24T18:09:38Z")

</div>

When I try compile ruby with make -j5 I got such messages: ruby ./tool/generic\_erb.rb --output=id.h ./template/id.h.tmpl –vpath=.ext/include/x86\_64-linux/ruby:./include/ruby:./enc:./missing parse.h id.h updated gc…

---

## [Error to gem install mysql](https://www.ruby-forum.com/t/error-to-gem-install-mysql/187516)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 1\
**Last updated:** [April 24, 2010, 4:13pm UTC](https://www.ruby-forum.com/t/error-to-gem-install-mysql/187516 "2010-04-24T16:13:01Z")

</div>

in my console: pt@pt-laptop:~$ sudo gem install mysql \[sudo\] password for pt: Building native extensions. This could take a while… ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /u…

---

## [Ocra](https://www.ruby-forum.com/t/ocra/187424)

<div class="topic-metadata">

**Author:** [@bankai](https://www.ruby-forum.com/u/bankai)\
**Replies:** 2\
**Last updated:** [April 24, 2010, 3:46pm UTC](https://www.ruby-forum.com/t/ocra/187424 "2010-04-24T15:46:08Z")

</div>

Hi All, Is it possible to package the sourcecode in to an .exe file with IronRuby? If not, will there be a tool in the near future for IronRuby to support this method? With the MRI version I can use OCRA or Rubyscri…

---

## [Ruby require problem](https://www.ruby-forum.com/t/ruby-require-problem/187490)

<div class="topic-metadata">

**Author:** [@Pablo\_E](https://www.ruby-forum.com/u/Pablo_E)\
**Replies:** 3\
**Last updated:** [April 24, 2010, 2:20pm UTC](https://www.ruby-forum.com/t/ruby-require-problem/187490 "2010-04-24T14:20:51Z")

</div>

I don’t get it. Why doesn’t ruby have just require/include for relative paths as it is in java, python etc. ? What’s wrong? it’s already 1.9 version which lacks these VERY basic and usual feature. Explain me plz.

---

## [DataMapper (was Re: Thread Priority)](https://www.ruby-forum.com/t/datamapper-was-re-thread-priority/187439)

<div class="topic-metadata">

**Author:** [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Replies:** 5\
**Last updated:** [April 24, 2010, 7:58am UTC](https://www.ruby-forum.com/t/datamapper-was-re-thread-priority/187439 "2010-04-24T07:58:42Z")

</div>

That’s a very good question actually; I know at least one Rails + DataMapper site that will switch to IronRuby if they can get it working (one I used to work on), so I’m personally interested in this as well. …

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

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