# Ruby

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

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

---

## [Retrieve the username](https://www.ruby-forum.com/t/retrieve-the-username/195697)

<div class="topic-metadata">

**Author:** [@arihan](https://www.ruby-forum.com/u/arihan)\
**Replies:** 2\
**Last updated:** [September 28, 2010, 11:57am UTC](https://www.ruby-forum.com/t/retrieve-the-username/195697 "2010-09-28T11:57:52Z")

</div>

Dear All, How would I get the username in mac through ruby like in windows I am using ENV\[‘USERNAME’\] ENV\[‘USERNAME’\]- it gives nil in mac system cheers A

---

## [3x3 Array of int, changing one value affects others](https://www.ruby-forum.com/t/3x3-array-of-int-changing-one-value-affects-others/195692)

<div class="topic-metadata">

**Author:** [@williams](https://www.ruby-forum.com/u/williams)\
**Replies:** 2\
**Last updated:** [September 28, 2010, 11:06am UTC](https://www.ruby-forum.com/t/3x3-array-of-int-changing-one-value-affects-others/195692 "2010-09-28T11:06:16Z")

</div>

ruby-1.9.2-head \> a = Array.new(3, Array.new(3, 0)) =\> \[\[0, 0, 0\], \[0, 0, 0\], \[0, 0, 0\]\] ruby-1.9.2-head \> a\[0\]\[2\] = 1 =\> 1 ruby-1.9.2-head \> a =\> \[\[0, 0, 1\], \[0, 0, 1\], \[0, 0, 1\]\] If the values aren’t all 0s, a\[0\]…

---

## [Encoding problems .. ruby 1.9.2](https://www.ruby-forum.com/t/encoding-problems-ruby-1-9-2/195612)

<div class="topic-metadata">

**Author:** [@bhayzone](https://www.ruby-forum.com/u/bhayzone)\
**Replies:** 6\
**Last updated:** [September 28, 2010, 8:08am UTC](https://www.ruby-forum.com/t/encoding-problems-ruby-1-9-2/195612 "2010-09-28T08:08:31Z")

</div>

I am pretty new to ruby and am trying to read text data coming from a backend which can only be queried using proprietary Command Line Interface commands. The problem is that this text data contains non-ascii characte…

---

## [Best way to integrate JRuby into existing Java Desktop application](https://www.ruby-forum.com/t/best-way-to-integrate-jruby-into-existing-java-desktop-application/195658)

<div class="topic-metadata">

**Author:** [@rogergue](https://www.ruby-forum.com/u/rogergue)\
**Replies:** 1\
**Last updated:** [September 28, 2010, 12:23am UTC](https://www.ruby-forum.com/t/best-way-to-integrate-jruby-into-existing-java-desktop-application/195658 "2010-09-28T00:23:05Z")

</div>

I need to develop some simple data entry forms for an existing Java application. Since doing this with JRuby is that more easy (and fun) I would like to integrate JRuby and some gems (ActiveRecord for example) into a…

---

## [Pluginfactory 1.0.7](https://www.ruby-forum.com/t/pluginfactory-1-0-7/195671)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 0\
**Last updated:** [September 27, 2010, 11:23pm UTC](https://www.ruby-forum.com/t/pluginfactory-1-0-7/195671 "2010-09-27T23:23:52Z")

</div>

Version 1.0.7 of pluginfactory has been released. PluginFactory is a mixin module that turns an including class into a factory for its derivatives, capable of searching for and loading them by name. This is useful whe…

---

## [Interpreter cannot enter in the context from another thread](https://www.ruby-forum.com/t/interpreter-cannot-enter-in-the-context-from-another-thread/195668)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 5\
**Last updated:** [September 27, 2010, 11:13pm UTC](https://www.ruby-forum.com/t/interpreter-cannot-enter-in-the-context-from-another-thread/195668 "2010-09-27T23:13:55Z")

</div>

This is a continuation of the thread: Re: Segmentation Fault; more info? Luis L. said: “Please note that Ruby 1.8.x is not multithread and that the interpreter cannot enter in the context from another thread.” Could…

---

## [Segmentation Fault; more info?](https://www.ruby-forum.com/t/segmentation-fault-more-info/195653)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 8\
**Last updated:** [September 27, 2010, 10:20pm UTC](https://www.ruby-forum.com/t/segmentation-fault-more-info/195653 "2010-09-27T22:20:38Z")

</div>

I am getting a segmentation fault. Is there some way to get more information about what caused the fault?

---

## [Ruby exception statement not suppressed within begin-rescue-end block](https://www.ruby-forum.com/t/ruby-exception-statement-not-suppressed-within-begin-rescue-end-block/194806)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 4\
**Last updated:** [September 27, 2010, 9:20pm UTC](https://www.ruby-forum.com/t/ruby-exception-statement-not-suppressed-within-begin-rescue-end-block/194806 "2010-09-27T21:20:55Z")

</div>

HI, I’ve got the code below. it creates the output: Exception \`NameError’ at ReformChartNames.rb:8 - uninitialized constant DATA “END” statement or subsequent directory-name missing Quitting job I thought the “Exc…

---

## [Need assistance with hash of arrays and injecting values](https://www.ruby-forum.com/t/need-assistance-with-hash-of-arrays-and-injecting-values/195569)

<div class="topic-metadata">

**Author:** [@elricstorm](https://www.ruby-forum.com/u/elricstorm)\
**Replies:** 6\
**Last updated:** [September 27, 2010, 7:26pm UTC](https://www.ruby-forum.com/t/need-assistance-with-hash-of-arrays-and-injecting-values/195569 "2010-09-27T19:26:48Z")

</div>

I’m creating a class that will run a number of tasks based on a start and end date. It only runs between week 4 and week 15 of my current system. A current hash of arrays is defined for the current calendar year the …

---

## [\[Bug: trunk\] Fwd: \[ruby-list:47272\] case when $B@0?t$H\<B?t$NHf3S(B (ruby 1.9)](https://www.ruby-forum.com/t/bug-trunk-fwd-ruby-list-47272-case-when-b-0-t-h-b-t-nhf3s-b-ruby-1-9/193306)

<div class="topic-metadata">

**Author:** [@SASADA\_Koichi](https://www.ruby-forum.com/u/SASADA_Koichi)\
**Replies:** 5\
**Last updated:** [September 27, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/bug-trunk-fwd-ruby-list-47272-case-when-b-0-t-h-b-t-nhf3s-b-ruby-1-9/193306 "2010-09-27T16:27:38Z")

</div>

e$B!!$5$5$@$G$9!%e(B e$B!!K\\7o$r%P%0$H$7$FEPO?$7$^$9!%e(B -------- Original Message -------- Subject: \[ruby-list:47272\] case when e$B@0?t$H\<B?t$NHf3Se(B (ruby 1.9) Date: Fri, 30 Jul 2010 14:41:58 +0900 From: e$B\>.ED…

---

## [Get Proc of current block?](https://www.ruby-forum.com/t/get-proc-of-current-block/193954)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 3\
**Last updated:** [September 27, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/get-proc-of-current-block/193954 "2010-09-27T16:22:21Z")

</div>

Is there any way to get a hold of the current block? I’ve been playing around with recursive enumerations and it occurs to me that the most flexible technique would simply be to reuse the currently running block. For…

---

## [Testing and requiring](https://www.ruby-forum.com/t/testing-and-requiring/195605)

<div class="topic-metadata">

**Author:** [@tensaiji](https://www.ruby-forum.com/u/tensaiji)\
**Replies:** 4\
**Last updated:** [September 27, 2010, 4:08pm UTC](https://www.ruby-forum.com/t/testing-and-requiring/195605 "2010-09-27T16:08:35Z")

</div>

Hi, I have an app/gem dir structure looking like this: appname (dir) Rakefile lib (dir) appname.rb appname (dir) class1.rb class2.rb t (dir) class1.t class2.t The appname.rb handles all the requires when the …

---

## [Re: Learning Shoes - Have some questions!](https://www.ruby-forum.com/t/re-learning-shoes-have-some-questions/195255)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [September 27, 2010, 3:45pm UTC](https://www.ruby-forum.com/t/re-learning-shoes-have-some-questions/195255 "2010-09-27T15:45:27Z")

</div>

Hi Ruby S., I tried subscribing to removed\_email\_address@domain.invalid but it was impossible! .org? I’m not sure it’s okay or not. But according to this Librelist web page: http://librelist.com/ You should send yo…

---

## [Eruby and/or mod\_ruby on apache not working with rubygem](https://www.ruby-forum.com/t/eruby-and-or-mod-ruby-on-apache-not-working-with-rubygem/195593)

<div class="topic-metadata">

**Author:** [@mysteri](https://www.ruby-forum.com/u/mysteri)\
**Replies:** 4\
**Last updated:** [September 27, 2010, 3:32pm UTC](https://www.ruby-forum.com/t/eruby-and-or-mod-ruby-on-apache-not-working-with-rubygem/195593 "2010-09-27T15:32:20Z")

</div>

Hi, I’m a web developer and wanted to try ruby. I installed ruby 1.8 on my debian server with eruby and mod\_ruby for apache2. Apache config files are configured correctly to accept .rhtml files and parse them. If I t…

---

## [JRuby and OpenID](https://www.ruby-forum.com/t/jruby-and-openid/195637)

<div class="topic-metadata">

**Author:** [@jeanluca](https://www.ruby-forum.com/u/jeanluca)\
**Replies:** 0\
**Last updated:** [September 27, 2010, 2:34pm UTC](https://www.ruby-forum.com/t/jruby-and-openid/195637 "2010-09-27T14:34:39Z")

</div>

I’m playing with JRuby and a Rails app that authenticate the users with OpenID. Unfortunately with MRI the example works fine…but not with JRuby. I can’t identity the problem, maybe could be a OpenSSL problem? I’ve…

---

## [Unable to retrieve data from tble](https://www.ruby-forum.com/t/unable-to-retrieve-data-from-tble/195536)

<div class="topic-metadata">

**Author:** [@arihan](https://www.ruby-forum.com/u/arihan)\
**Replies:** 2\
**Last updated:** [September 27, 2010, 11:45am UTC](https://www.ruby-forum.com/t/unable-to-retrieve-data-from-tble/195536 "2010-09-27T11:45:09Z")

</div>

Hi All, I am unable to retrieve data from table.The screenshot is also attached for determining the position of table in the database. Any thoughts how to sort it out? I am using Postgres #The table name is MasterUse…

---

## [Bug in gsub(?)](https://www.ruby-forum.com/t/bug-in-gsub/195574)

<div class="topic-metadata">

**Author:** [@giuan](https://www.ruby-forum.com/u/giuan)\
**Replies:** 8\
**Last updated:** [September 27, 2010, 10:29am UTC](https://www.ruby-forum.com/t/bug-in-gsub/195574 "2010-09-27T10:29:56Z")

</div>

I have found this bug(?) in gsub puts “\\:{}=#~”.gsub(/(\[\\:~=#{}\])/, ‘\\ \\1’) =\> \\ \\ :\\ {\\ }\\ =\\ #\\ ~ OK but puts “\\:{}=#~”.gsub(/(\[\\:~=#{}\])/, ‘\\\\1’) =\> \\1\\1\\1\\1\\1\\1\\1 Any idea?

---

## [Error "copyplist failed with exit code 127"](https://www.ruby-forum.com/t/error-copyplist-failed-with-exit-code-127/195566)

<div class="topic-metadata">

**Author:** [@shortnose](https://www.ruby-forum.com/u/shortnose)\
**Replies:** 8\
**Last updated:** [September 27, 2010, 9:48am UTC](https://www.ruby-forum.com/t/error-copyplist-failed-with-exit-code-127/195566 "2010-09-27T09:48:26Z")

</div>

Morning everyone, I’m not a ruby developer (using XCode) but facing an error which is coming from the ruby file "copyplist " locate under : /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/…

---

## [Qt::UiLoader -\> uninitialized constant Qt::QUiLoader](https://www.ruby-forum.com/t/qt-uiloader-uninitialized-constant-qt-quiloader/195610)

<div class="topic-metadata">

**Author:** [@Markus\_F](https://www.ruby-forum.com/u/Markus_F)\
**Replies:** 3\
**Last updated:** [September 27, 2010, 8:57am UTC](https://www.ruby-forum.com/t/qt-uiloader-uninitialized-constant-qt-quiloader/195610 "2010-09-27T08:57:57Z")

</div>

Hi, using 1.9.2p0 and qtbindings (4.6.3.0) I always get $ ruby -rQt -e ‘Qt::UiLoader.new’ -e:1:in const\_missing': uninitialized constant Qt::UiLoader (NameError) from -e:1:in ’ According to it should be there. I…

---

## [Help -- qt, ruby, ms-windows?](https://www.ruby-forum.com/t/help-qt-ruby-ms-windows/195618)

<div class="topic-metadata">

**Author:** [@will](https://www.ruby-forum.com/u/will)\
**Replies:** 1\
**Last updated:** [September 27, 2010, 8:29am UTC](https://www.ruby-forum.com/t/help-qt-ruby-ms-windows/195618 "2010-09-27T08:29:16Z")

</div>

Hi there… Is there someone who is successfully running qtruby with mswin32 and ruby 1.8.7 for qt v6.3? If that’s you – What did you need to install and do to get it working? Also for the qt people, I love the tutori…

---

## [Listing out available variables in an ERB template](https://www.ruby-forum.com/t/listing-out-available-variables-in-an-erb-template/195619)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 1\
**Last updated:** [September 27, 2010, 5:55am UTC](https://www.ruby-forum.com/t/listing-out-available-variables-in-an-erb-template/195619 "2010-09-27T05:55:21Z")

</div>

Hi All, Suppose I have a Ruby ERB template named my\_template.html.erb, and it contains the following: \<div\>\<%= @div\_1 %\>\</div\> \<div\>\<%= @div\_2 %\>\</div\> \<div\>\<%= @div\_3 %\>\</div\> Is there a way I can programatically l…

---

## [Fw: man-pages-3.27 released](https://www.ruby-forum.com/t/fw-man-pages-3-27-released/195622)

<div class="topic-metadata">

**Author:** [@KOSAKI\_Motohiro](https://www.ruby-forum.com/u/KOSAKI_Motohiro)\
**Replies:** 0\
**Last updated:** [September 27, 2010, 4:32am UTC](https://www.ruby-forum.com/t/fw-man-pages-3-27-released/195622 "2010-09-27T04:32:15Z")

</div>

å°å´Žã§ã™ ä»¥å‰ã€Linuxã®atanh(3)ã®EDOMã®æ‰±ã„ãŒå®Ÿè£…ã¨manã¨ã§ä¸€è‡´ã—ã¦ã„ãªã„ã¨ã„ã†æŒ‡æ‘˜ã‚’ ã†ã‘ãŸã®ã§ã™ãŒï¼ˆã“ã®MLã ã£ãŸã‹ã€IRCã ã£ãŸã‹æ€ã„å‡ºã›ã¾ã›ã‚“ã€‚ã™ã„ã¾ã›ã‚“ï¼…

---

## [Mixing string formatting with system exec](https://www.ruby-forum.com/t/mixing-string-formatting-with-system-exec/195608)

<div class="topic-metadata">

**Author:** [@diemorph](https://www.ruby-forum.com/u/diemorph)\
**Replies:** 2\
**Last updated:** [September 27, 2010, 3:43am UTC](https://www.ruby-forum.com/t/mixing-string-formatting-with-system-exec/195608 "2010-09-27T03:43:30Z")

</div>

noob questionâ€¦ why does this line produce the following result? %x("%s %s" % \[’/usr/bin/touch’, ‘/tmp/test’\]) error: sh: line 0: fg: no job control i don’t necessarily need to use string formatting or substitution…

---

## [Help! Undefined local variable](https://www.ruby-forum.com/t/help-undefined-local-variable/195615)

<div class="topic-metadata">

**Author:** [@anthonyob](https://www.ruby-forum.com/u/anthonyob)\
**Replies:** 3\
**Last updated:** [September 27, 2010, 1:41am UTC](https://www.ruby-forum.com/t/help-undefined-local-variable/195615 "2010-09-27T01:41:20Z")

</div>

p009mymethods1.rb:11: undefined local variable or method ‘mtd’ for main"object =begin p008mymethods1.rb interpolation refers to the process of inserting the result of an expression into a string literal the interp…

---

## [Ruby, Unicode, and HTML Entities Problem](https://www.ruby-forum.com/t/ruby-unicode-and-html-entities-problem/195601)

<div class="topic-metadata">

**Author:** [@mrpeepers](https://www.ruby-forum.com/u/mrpeepers)\
**Replies:** 4\
**Last updated:** [September 26, 2010, 10:14pm UTC](https://www.ruby-forum.com/t/ruby-unicode-and-html-entities-problem/195601 "2010-09-26T22:14:09Z")

</div>

Hi all, Using Ruby (and REXML) to parse a directory full of HTML files mixed with Spanish but mostly English. For the most part, Ruby can correctly parse the HTML. That’s all fine and dandy, BUT, when there’s a unic…

---

## [Sort hash with keys as integer](https://www.ruby-forum.com/t/sort-hash-with-keys-as-integer/195570)

<div class="topic-metadata">

**Author:** [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Replies:** 3\
**Last updated:** [September 26, 2010, 10:03pm UTC](https://www.ruby-forum.com/t/sort-hash-with-keys-as-integer/195570 "2010-09-26T22:03:34Z")

</div>

I have problems with sorting a hash. I get this sort 1,10,2,3… Must be because the key is a string, right? How do I deal with this? How do I make the key value into an integer?

---

## [SMTP with Gmail in 1.9.2](https://www.ruby-forum.com/t/smtp-with-gmail-in-1-9-2/195591)

<div class="topic-metadata">

**Author:** [@trib4lmaniac](https://www.ruby-forum.com/u/trib4lmaniac)\
**Replies:** 1\
**Last updated:** [September 26, 2010, 9:03pm UTC](https://www.ruby-forum.com/t/smtp-with-gmail-in-1-9-2/195591 "2010-09-26T21:03:43Z")

</div>

Hi guys, I’ve got a program that has been working fine running 1.8.6 using the smtp\_tls gem to send emails via my gmail account. I’v now removed the smtp\_tls gem because I was under the impression it was included in …

---

## [Ruby error](https://www.ruby-forum.com/t/ruby-error/195596)

<div class="topic-metadata">

**Author:** [@woow](https://www.ruby-forum.com/u/woow)\
**Replies:** 2\
**Last updated:** [September 26, 2010, 3:56pm UTC](https://www.ruby-forum.com/t/ruby-error/195596 "2010-09-26T15:56:15Z")

</div>

Please help me to figure why ruby is throwing following error… following is my code. #!/usr/bin/ruby require ‘procStartupTimes’ require ‘rubygems’ require ‘gruff’ g = Gruff::Line.new g.title = “My Graph” a = \[1, 2…

---

## [How do i force ruby to release memory](https://www.ruby-forum.com/t/how-do-i-force-ruby-to-release-memory/195515)

<div class="topic-metadata">

**Author:** [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Replies:** 18\
**Last updated:** [September 26, 2010, 1:46pm UTC](https://www.ruby-forum.com/t/how-do-i-force-ruby-to-release-memory/195515 "2010-09-26T13:46:02Z")

</div>

Hi all, I would like to know is there any way to ask ruby to release memory. because for me its not happening automatically…garbase collection

---

## [Search for a string in another string allowing mismatches](https://www.ruby-forum.com/t/search-for-a-string-in-another-string-allowing-mismatches/195331)

<div class="topic-metadata">

**Author:** [@janus](https://www.ruby-forum.com/u/janus)\
**Replies:** 3\
**Last updated:** [September 26, 2010, 10:34am UTC](https://www.ruby-forum.com/t/search-for-a-string-in-another-string-allowing-mismatches/195331 "2010-09-26T10:34:04Z")

</div>

Hi all, I’m sure this is a very common problem. But can’t find a simple & efficient way of solving it. Basically, I want to find out if a string contains my search string as a substring. However, a certain amount of …

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

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