# Ruby

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

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

---

## [Local Area Play](https://www.ruby-forum.com/t/local-area-play/194199)

<div class="topic-metadata">

**Author:** [@andr92](https://www.ruby-forum.com/u/andr92)\
**Replies:** 2\
**Last updated:** [September 1, 2010, 2:16am UTC](https://www.ruby-forum.com/t/local-area-play/194199 "2010-09-01T02:16:33Z")

</div>

Hello. I’m working on a school project and creating a game. It will not be something super advanced but i still want some cool features. One of those features is multiplayer on network, a client and server based. Tho…

---

## [Ed Lambda: Functional programming meetup in Edinburgh](https://www.ruby-forum.com/t/ed-lambda-functional-programming-meetup-in-edinburgh/194198)

<div class="topic-metadata">

**Author:** [@ole](https://www.ruby-forum.com/u/ole)\
**Replies:** 0\
**Last updated:** [September 1, 2010, 12:50am UTC](https://www.ruby-forum.com/t/ed-lambda-functional-programming-meetup-in-edinburgh/194198 "2010-09-01T00:50:27Z")

</div>

Hi guys, I’m running a meetup for functional programming in Edinburgh. The first one will be on the 13th of September at Malone’s Irish Bar (14 Forrest Road) and will continue every 2nd monday of each month. For the …

---

## [Time.local and offsets](https://www.ruby-forum.com/t/time-local-and-offsets/193864)

<div class="topic-metadata">

**Author:** [@fxn](https://www.ruby-forum.com/u/fxn)\
**Replies:** 8\
**Last updated:** [August 31, 2010, 11:23pm UTC](https://www.ruby-forum.com/t/time-local-and-offsets/193864 "2010-08-31T23:23:16Z")

</div>

Does anyone know why Time.local gives these offsets here? (+0100 is correct) fxn@rails:~/rails/activerecord$ rvm use 1.8.7 info: Using ruby 1.8.7 p302 fxn@rails:~/rails/activerecord$ ruby -e ‘p Time.local(2010); p T…

---

## [Ruby / Rails Training](https://www.ruby-forum.com/t/ruby-rails-training/194190)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [August 31, 2010, 9:35pm UTC](https://www.ruby-forum.com/t/ruby-rails-training/194190 "2010-08-31T21:35:32Z")

</div>

I am not sure if anything like this exists so thought I would ask the experts. I am looking for a part-time learning program focused around Ruby and Rails. Novice to inter-mediate level. What I am looking for is a st…

---

## [Mongoid dependency problems](https://www.ruby-forum.com/t/mongoid-dependency-problems/194194)

<div class="topic-metadata">

**Author:** [@stalkert](https://www.ruby-forum.com/u/stalkert)\
**Replies:** 0\
**Last updated:** [August 31, 2010, 8:57pm UTC](https://www.ruby-forum.com/t/mongoid-dependency-problems/194194 "2010-08-31T20:57:35Z")

</div>

I’m new to Ruby and struggling to understand some dependency problems while trying to write a very basic script that uses Mongoid to write to a MongoDB. I’m not using Rails or anything, just a single Ruby script runni…

---

## [Ok, so no $KCODE --a chance to learn a little about Encodings](https://www.ruby-forum.com/t/ok-so-no-kcode-a-chance-to-learn-a-little-about-encodings/194188)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 1\
**Last updated:** [August 31, 2010, 8:18pm UTC](https://www.ruby-forum.com/t/ok-so-no-kcode-a-chance-to-learn-a-little-about-encodings/194188 "2010-08-31T20:18:14Z")

</div>

I am working on some 1.8 to 1.9 compatibility. I have a bit of code: if $KCODE =~ /^U/i unpack\_rule = 'U\*' else unpack\_rule = 'C\*' end $KCODE is no long effective, so what to do for 1.9?

---

## [Ruby 1.9.2 Constant Lookup with BasicObject](https://www.ruby-forum.com/t/ruby-1-9-2-constant-lookup-with-basicobject/194125)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 5\
**Last updated:** [August 31, 2010, 7:30pm UTC](https://www.ruby-forum.com/t/ruby-1-9-2-constant-lookup-with-basicobject/194125 "2010-08-31T19:30:14Z")

</div>

ruby-1.9.2-p0 \> module M ruby-1.9.2-p0 ?\> end =\> nil ruby-1.9.2-p0 \> class X \< BasicObject ruby-1.9.2-p0 ?\> include M ruby-1.9.2-p0 ?\> end NameError: uninitialized constant X::M from (irb):4:in \<class:X\>' fro…

---

## [Automating sinatra deployments to trinidad](https://www.ruby-forum.com/t/automating-sinatra-deployments-to-trinidad/194185)

<div class="topic-metadata">

**Author:** [@pyr0](https://www.ruby-forum.com/u/pyr0)\
**Replies:** 2\
**Last updated:** [August 31, 2010, 6:39pm UTC](https://www.ruby-forum.com/t/automating-sinatra-deployments-to-trinidad/194185 "2010-08-31T18:39:18Z")

</div>

I am looking to automate the deployment process of a sinatra app to trinidad. Anyone recommendations or guidelines on this? Do people use capistrano for this? thx. -karl

---

## [The nice new braintree\_orange\_test.rb is confused about what "purchases" are](https://www.ruby-forum.com/t/the-nice-new-braintree-orange-test-rb-is-confused-about-what-purchases-are/194135)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 2\
**Last updated:** [August 31, 2010, 6:25pm UTC](https://www.ruby-forum.com/t/the-nice-new-braintree-orange-test-rb-is-confused-about-what-purchases-are/194135 "2010-08-31T18:25:50Z")

</div>

…inside the otherwise truly awesome ActiveGateway: def test\_successful\_purchase @gateway.expects(:ssl\_post).returns(successful\_purchase\_response) assert response = @gateway.authorize(@amount, @credit\_card, @options) …

---

## [\[Ruby 1.9-Bug#3774\] irb$B$GF|K\\8l$,F~NO$G$-$J$$(B](https://www.ruby-forum.com/t/ruby-1-9-bug-3774-irb-b-gf-k-8l-f-no-g-j-b/194183)

<div class="topic-metadata">

**Author:** [@Takeyuki\_F](https://www.ruby-forum.com/u/Takeyuki_F)\
**Replies:** 0\
**Last updated:** [August 31, 2010, 6:12pm UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3774-irb-b-gf-k-8l-f-no-g-j-b/194183 "2010-08-31T18:12:22Z")

</div>

e$B%A%1%C%He(B #3774 e$B$,99?7$5$l$^$7$?!#e(B (by Takeyuki F.) rvm install ruby-head -C --with-readline-dir=/opt/local –enable-readline-v6 e$B$@$H$$$1$^$7$?!#e(B http://redmine.ruby-lang.org/issues/show/3774

---

## [\[Ruby 1.9-Bug#3774\]\[Rejected\] irb$B$GF|K\\8l$,F~NO$G$-$J$$(B](https://www.ruby-forum.com/t/ruby-1-9-bug-3774-rejected-irb-b-gf-k-8l-f-no-g-j-b/194182)

<div class="topic-metadata">

**Author:** [@Yui\_NARUSE](https://www.ruby-forum.com/u/Yui_NARUSE)\
**Replies:** 0\
**Last updated:** [August 31, 2010, 5:55pm UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3774-rejected-irb-b-gf-k-8l-f-no-g-j-b/194182 "2010-08-31T17:55:58Z")

</div>

e$B%A%1%C%He(B #3774 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BRejectede$B$KJQ99e(B heade$B$NJ}$K$O0J2\<$N$h$&$K=P$F$$$^$9!#e(B 73 …/…/./include/ruby/ruby.h:1419:1: warning: this is the lo…

---

## [Can't convert string to integer](https://www.ruby-forum.com/t/cant-convert-string-to-integer/194176)

<div class="topic-metadata">

**Author:** [@dennismajor1](https://www.ruby-forum.com/u/dennismajor1)\
**Replies:** 5\
**Last updated:** [August 31, 2010, 5:33pm UTC](https://www.ruby-forum.com/t/cant-convert-string-to-integer/194176 "2010-08-31T17:33:43Z")

</div>

I am a newbie to Ruby so I apologize for my ignorance. I am trying to parse a JSON object but I keep getting the error of Can’t convert string to integer. json = JSON.parse(resp.body) json\[‘member\_id’\].to\_i I have N…

---

## [A small problem for arrays](https://www.ruby-forum.com/t/a-small-problem-for-arrays/193666)

<div class="topic-metadata">

**Author:** [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Replies:** 10\
**Last updated:** [August 31, 2010, 2:58pm UTC](https://www.ruby-forum.com/t/a-small-problem-for-arrays/193666 "2010-08-31T14:58:33Z")

</div>

I have 2 array. ar\_1, ar\_2 How can we, on the basis of existing arrays to create an array ar\_3, of all the elements that are ar\_1 and are not included in ar\_2.

---

## [How to get the table?](https://www.ruby-forum.com/t/how-to-get-the-table/194148)

<div class="topic-metadata">

**Author:** [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Replies:** 2\
**Last updated:** [August 31, 2010, 2:25pm UTC](https://www.ruby-forum.com/t/how-to-get-the-table/194148 "2010-08-31T14:25:05Z")

</div>

please input in firefox,you can get the attachmeng http://www.sec.gov/cgi-bin/viewer?action=view&cik=804328&accession\_number=0000950123-10-066837 i write the code: require ‘rubygems’ require ‘open-uri’ web=‘http:/…

---

## [\[ANN\] Money 3.1.0.pre3](https://www.ruby-forum.com/t/ann-money-3-1-0-pre3/194166)

<div class="topic-metadata">

**Author:** [@semmons99](https://www.ruby-forum.com/u/semmons99)\
**Replies:** 0\
**Last updated:** [August 31, 2010, 2:19pm UTC](https://www.ruby-forum.com/t/ann-money-3-1-0-pre3/194166 "2010-08-31T14:19:40Z")

</div>

Money 3.1.0.pre3 released added google\_currency.gem to list of Currency Exchange Implementations updated HKD :subunit\_to\_unit from 10 to 100 (closes #20) added #(export/import)\_rates to Money::bank::VariableExchange (…

---

## [XSLT-like search in a Ruby Hash](https://www.ruby-forum.com/t/xslt-like-search-in-a-ruby-hash/194141)

<div class="topic-metadata">

**Author:** [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Replies:** 2\
**Last updated:** [August 31, 2010, 2:18pm UTC](https://www.ruby-forum.com/t/xslt-like-search-in-a-ruby-hash/194141 "2010-08-31T14:18:09Z")

</div>

I have a need for some relatively fancy searching in a hash, and I am wondering if there’s anything that does some kind of pattern matching on Hash contents. Specifically here’s an example of what I would like to be a…

---

## [\[Ruby 1.9-Bug#3771\]\[Open\] VC++ can't make ext/tk with enabling stubs](https://www.ruby-forum.com/t/ruby-1-9-bug-3771-open-vc-cant-make-ext-tk-with-enabling-stubs/194152)

<div class="topic-metadata">

**Author:** [@Akio\_T](https://www.ruby-forum.com/u/Akio_T)\
**Replies:** 2\
**Last updated:** [August 31, 2010, 12:07pm UTC](https://www.ruby-forum.com/t/ruby-1-9-bug-3771-open-vc-cant-make-ext-tk-with-enabling-stubs/194152 "2010-08-31T12:07:01Z")

</div>

Bug #3771: VC++ can’t make ext/tk with enabling stubs http://redmine.ruby-lang.org/issues/show/3771 e$B5/I\<\<Te(B: Akio T. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: ext, Target version: 1.9.2 ruby …

---

## [Bug #3722 $B$K4X$9$k$4Js9p(B](https://www.ruby-forum.com/t/bug-3722-b-k4x-9-k-4js9p-b/194159)

<div class="topic-metadata">

**Author:** [@Satoshi\_Shiba](https://www.ruby-forum.com/u/Satoshi_Shiba)\
**Replies:** 0\
**Last updated:** [August 31, 2010, 10:43am UTC](https://www.ruby-forum.com/t/bug-3722-b-k4x-9-k-4js9p-b/194159 "2010-08-31T10:43:53Z")

</div>

e$B\<G$H?=$7$^$9!#e(B redmine e$B$KEPO?$5$l$F$$$ke(B Bug #3722 \[ruby-core:31783\] e$B$K$D$$$FD4$Y$?$H$3e(B e$B$m!“e(BEXEC\_EVENT\_HOOK e$B;~$NNc30\>pJse(B(th-\>state)e$B$N07$$$KLdBj$,$”$j$=$&$G$9!#e(B e$B%P%0Js9p$KE=$jIU$…

---

## [\[Feature #3753\] value of def-expr](https://www.ruby-forum.com/t/feature-3753-value-of-def-expr/194029)

<div class="topic-metadata">

**Author:** [@Usaku\_NAKAMURA](https://www.ruby-forum.com/u/Usaku_NAKAMURA)\
**Replies:** 1\
**Last updated:** [August 31, 2010, 10:11am UTC](https://www.ruby-forum.com/t/feature-3753-value-of-def-expr/194029 "2010-08-31T10:11:42Z")

</div>

Feature #3753: value of def-expr http://redmine.ruby-lang.org/issues/show/3753 e$B5/I\<\<Te(B: Usaku NAKAMURA e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal RubyKaigie$B8+$F$F;W$$=P$7$?$N$G$9$,!"e(Bdefe$B\<0$Oe(BSymbole$B…

---

## [Require from a method](https://www.ruby-forum.com/t/require-from-a-method/194056)

<div class="topic-metadata">

**Author:** [@ammar](https://www.ruby-forum.com/u/ammar)\
**Replies:** 6\
**Last updated:** [August 31, 2010, 8:15am UTC](https://www.ruby-forum.com/t/require-from-a-method/194056 "2010-08-31T08:15:45Z")

</div>

Hello, Are there any gotchas in requiring files from within a method? It seems to work, but I have a sinking feeling that I’m missing something here. def require\_relative(start, path) require File.expand\_path( File.…

---

## [\[Ruby-Bug#3770\]\[Open\] ruby test/dl/test\_callback.rb$B$G(BBus Error](https://www.ruby-forum.com/t/ruby-bug-3770-open-ruby-test-dl-test-callback-rb-b-g-bbus-error/194151)

<div class="topic-metadata">

**Author:** [@Shota\_F](https://www.ruby-forum.com/u/Shota_F)\
**Replies:** 0\
**Last updated:** [August 31, 2010, 6:31am UTC](https://www.ruby-forum.com/t/ruby-bug-3770-open-ruby-test-dl-test-callback-rb-b-g-bbus-error/194151 "2010-08-31T06:31:35Z")

</div>

Bug #3770: ruby test/dl/test\_callback.rbe$B$Ge(BBus Error http://redmine.ruby-lang.org/issues/show/3770 e$B5/I\<\<Te(B: Shota F. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal ruby -v: ruby 1.9.3dev (2010-08-30 trunk 291…

---

## [Playing raw PCM files in ruby](https://www.ruby-forum.com/t/playing-raw-pcm-files-in-ruby/194071)

<div class="topic-metadata">

**Author:** [@boothy](https://www.ruby-forum.com/u/boothy)\
**Replies:** 6\
**Last updated:** [August 31, 2010, 12:56am UTC](https://www.ruby-forum.com/t/playing-raw-pcm-files-in-ruby/194071 "2010-08-31T00:56:09Z")

</div>

Hello everyone, I am trying to play the music from the old game “Ascendancy” using Ruby, the files are 8-bit unsigned raw PCM files at 22 khz. I thought about using SDL for playing them, but I can’t seem to find any w…

---

## [Ruby 1.9.1-p129](https://www.ruby-forum.com/t/ruby-1-9-1-p129/191597)

<div class="topic-metadata">

**Author:** [@Wesley\_W](https://www.ruby-forum.com/u/Wesley_W)\
**Replies:** 8\
**Last updated:** [August 31, 2010, 12:25am UTC](https://www.ruby-forum.com/t/ruby-1-9-1-p129/191597 "2010-08-31T00:25:39Z")

</div>

I was trying to install ruby 1.9.1-p129 through RVM and got this error message. Any ideas? Thanks, Wesley \[2010-07-14 16:49:51\] make eval.c: In function ‘ruby\_cleanup’: eval.c:139: warning: passing argument 1 of ‘r…

---

## [Stuck on "No route matches" when porting to rails 3.0](https://www.ruby-forum.com/t/stuck-on-no-route-matches-when-porting-to-rails-3-0/194137)

<div class="topic-metadata">

**Author:** [@ther](https://www.ruby-forum.com/u/ther)\
**Replies:** 1\
**Last updated:** [August 30, 2010, 11:43pm UTC](https://www.ruby-forum.com/t/stuck-on-no-route-matches-when-porting-to-rails-3-0/194137 "2010-08-30T23:43:59Z")

</div>

I don’t do anything special. This should work, but it doesn’t. Portal::Application.routes.draw do |map| map.root :controller =\> “portal”, :action =\> “logout” map.connect ‘:controller/:action/:id’ map.connect ‘:contro…

---

## [The nice new braintree\_orange](https://www.ruby-forum.com/t/the-nice-new-braintree-orange/194133)

<div class="topic-metadata">

**Author:** [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Replies:** 0\
**Last updated:** [August 30, 2010, 11:16pm UTC](https://www.ruby-forum.com/t/the-nice-new-braintree-orange/194133 "2010-08-30T23:16:00Z")

</div>

def test\_successful\_purchase @gateway.expects(:ssl\_post).returns(successful\_purchase\_response) assert response = @gateway.authorize(@amount, @credit\_card, @options) assert\_instance\_of Response, response assert\_succe…

---

## [Ffi-ncurses 0.3.3](https://www.ruby-forum.com/t/ffi-ncurses-0-3-3/193822)

<div class="topic-metadata">

**Author:** [@sean](https://www.ruby-forum.com/u/sean)\
**Replies:** 21\
**Last updated:** [August 30, 2010, 10:11pm UTC](https://www.ruby-forum.com/t/ffi-ncurses-0-3-3/193822 "2010-08-30T22:11:01Z")

</div>

I’ve just released version 0.3.3 of the ffi-ncurses gem. This fixes the long-standing issue of not being compatible with ffi version 0.6.x. Apologies to all who requested this change months ago. = What is ffi-ncurses? …

---

## [Time#round in 1.9](https://www.ruby-forum.com/t/time-round-in-1-9/194129)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 2\
**Last updated:** [August 30, 2010, 9:47pm UTC](https://www.ruby-forum.com/t/time-round-in-1-9/194129 "2010-08-30T21:47:00Z")

</div>

Anyone know about Time#round in 1.9. Apparently it exists but it seems to do nothing but eat up cpu cycles. ruby-1.9.2-p0 \> t = Time.new =\> 2010-08-30 14:34:03 -0400 ruby-1.9.2-p0 \> t.round(100000) =\> 2010-08-30 14:…

---

## [Ruby v1.91 won't match literal plus sign](https://www.ruby-forum.com/t/ruby-v1-91-wont-match-literal-plus-sign/194110)

<div class="topic-metadata">

**Author:** [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Replies:** 2\
**Last updated:** [August 30, 2010, 9:45pm UTC](https://www.ruby-forum.com/t/ruby-v1-91-wont-match-literal-plus-sign/194110 "2010-08-30T21:45:49Z")

</div>

text = “++” puts “matched plus sign” if text.index(/++/, 0) Prints nothing. Using Regex.quote produces the same behavior. A forum registration quiz, “puts ((‘11’ \* 2).to\_i)/2” also prints nothing but v1.86 prints 555…

---

## [Structural conceptual design of a slab as per EC2](https://www.ruby-forum.com/t/structural-conceptual-design-of-a-slab-as-per-ec2/194131)

<div class="topic-metadata">

**Author:** [@datulravi](https://www.ruby-forum.com/u/datulravi)\
**Replies:** 0\
**Last updated:** [August 30, 2010, 9:05pm UTC](https://www.ruby-forum.com/t/structural-conceptual-design-of-a-slab-as-per-ec2/194131 "2010-08-30T21:05:56Z")

</div>

I need a conceptual design plugin of Ruby for Sketchup for a concete slab as per EC2. Please someone help me with the plugin. In case you have a similar plugin please post the link. Else guide me to how to create the …

---

## [Problems using gets() on a socket](https://www.ruby-forum.com/t/problems-using-gets-on-a-socket/194044)

<div class="topic-metadata">

**Author:** [@geometic](https://www.ruby-forum.com/u/geometic)\
**Replies:** 2\
**Last updated:** [August 30, 2010, 7:38pm UTC](https://www.ruby-forum.com/t/problems-using-gets-on-a-socket/194044 "2010-08-30T19:38:49Z")

</div>

Hi, I have built a telnet “chat server” using TCPserver and a select statement. If a client exits “cleanly” (such as by closing the shell in which telnet is running), I can recognize the socket as being terminated us…

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

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