# Ruby

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

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

---

## [Can I do this with Ruby?](https://www.ruby-forum.com/t/can-i-do-this-with-ruby/187898)

<div class="topic-metadata">

**Author:** [@marlon](https://www.ruby-forum.com/u/marlon)\
**Replies:** 3\
**Last updated:** [May 1, 2010, 9:36am UTC](https://www.ruby-forum.com/t/can-i-do-this-with-ruby/187898 "2010-05-01T09:36:00Z")

</div>

I have very little knowledge in programming. I tried to learn Visual BASIC couple of years ago but gave up. The extent of my programming skills is laughable. The most complicated program I can make is as follows: …

---

## [File.read(fname) vs. File.read(fname,File.size(fname))](https://www.ruby-forum.com/t/file-read-fname-vs-file-read-fname-file-size-fname/187875)

<div class="topic-metadata">

**Author:** [@alexd](https://www.ruby-forum.com/u/alexd)\
**Replies:** 4\
**Last updated:** [May 1, 2010, 7:48am UTC](https://www.ruby-forum.com/t/file-read-fname-vs-file-read-fname-file-size-fname/187875 "2010-05-01T07:48:57Z")

</div>

Hi, this is my first post on ruby-forum. Hope this is useful to someone! I have learned from experience to avoid reading files using File.read(filename)… it gives terrible performance on even moderately large files. R…

---

## [\[Bug #3229\] iseq\_s\_load $B$G(B TypeError $BH/@8(B](https://www.ruby-forum.com/t/bug-3229-iseq-s-load-b-g-b-typeerror-bh-8-b/187897)

<div class="topic-metadata">

**Author:** [@Tomoyuki\_C](https://www.ruby-forum.com/u/Tomoyuki_C)\
**Replies:** 0\
**Last updated:** [May 1, 2010, 4:57am UTC](https://www.ruby-forum.com/t/bug-3229-iseq-s-load-b-g-b-typeerror-bh-8-b/187897 "2010-05-01T04:57:28Z")

</div>

Bug #3229: iseq\_s\_load e$B$Ge(B TypeError e$BH/@8e(B http://redmine.ruby-lang.org/issues/show/3229 e$B5/I\<\<Te(B: Tomoyuki C. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal ruby -v: ruby 1.9.2dev (2010-04-30 trunk 27566…

---

## [Installing a ruby gem with a native extension](https://www.ruby-forum.com/t/installing-a-ruby-gem-with-a-native-extension/187828)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 7\
**Last updated:** [May 1, 2010, 12:35am UTC](https://www.ruby-forum.com/t/installing-a-ruby-gem-with-a-native-extension/187828 "2010-05-01T00:35:17Z")

</div>

I am new to ruby. I want to install a ruby gem which tries to build a native extension. The gem in this case is nokogiri. If I do gem install nokogiri, the native extension dynamically links against libxml, libxslt li…

---

## [Setting to Ruby 1.9 in Ubuntu](https://www.ruby-forum.com/t/setting-to-ruby-1-9-in-ubuntu/187884)

<div class="topic-metadata">

**Author:** [@Xeno\_CSS\_Eskimo\_No](https://www.ruby-forum.com/u/Xeno_CSS_Eskimo_No)\
**Replies:** 14\
**Last updated:** [May 1, 2010, 12:24am UTC](https://www.ruby-forum.com/t/setting-to-ruby-1-9-in-ubuntu/187884 "2010-05-01T00:24:10Z")

</div>

I tried installing a bunch of ruby 1.9 stuff on my Ubuntu laptop last night, but my default ruby is still 1.8.7. Anybody know a regular method for setting to 1.9 on Ubuntu? Perhaps this is an Ubuntu question, but p…

---

## [Jruby + rails 2.3.5 + glassfish gem performance problems](https://www.ruby-forum.com/t/jruby-rails-2-3-5-glassfish-gem-performance-problems/187867)

<div class="topic-metadata">

**Author:** [@corin](https://www.ruby-forum.com/u/corin)\
**Replies:** 1\
**Last updated:** [May 1, 2010, 12:20am UTC](https://www.ruby-forum.com/t/jruby-rails-2-3-5-glassfish-gem-performance-problems/187867 "2010-05-01T00:20:04Z")

</div>

Hi! I’m currently using passenger with ree 1.8.7 in production for a rails 2.3.5 project using postgresql as a database. Current performance: ab -n 10000 -c 100: 285.69 \[#/sec\] (mean) I read jruby should be the faste…

---

## [1.5's ant integration - hyphenation usage?](https://www.ruby-forum.com/t/1-5s-ant-integration-hyphenation-usage/187886)

<div class="topic-metadata">

**Author:** [@ratchetcat](https://www.ruby-forum.com/u/ratchetcat)\
**Replies:** 0\
**Last updated:** [April 30, 2010, 11:35pm UTC](https://www.ruby-forum.com/t/1-5s-ant-integration-hyphenation-usage/187886 "2010-04-30T23:35:00Z")

</div>

I’m jazzed about the new ant integration and just started looking into it for an upcoming Flex/AIR project. Unfortunately the Flex ant tasks and compiler config naming is causing more typing than needed. I’m having t…

---

## [TCPServer issue](https://www.ruby-forum.com/t/tcpserver-issue/187878)

<div class="topic-metadata">

**Author:** [@tilde](https://www.ruby-forum.com/u/tilde)\
**Replies:** 3\
**Last updated:** [April 30, 2010, 9:15pm UTC](https://www.ruby-forum.com/t/tcpserver-issue/187878 "2010-04-30T21:15:41Z")

</div>

Hi Someone knows why this source #! /usr/bin/env ruby require ‘socket’ srv = TCPServer.new ‘localhost’, 20000 loop do Thread.start (srv.accept) do |s| s.write time.now s.close end end causes this?: code/ruby/…

---

## [JRuby 1.5.0.RC2 Released](https://www.ruby-forum.com/t/jruby-1-5-0-rc2-released/187760)

<div class="topic-metadata">

**Author:** [@Thomas\_E\_Enebo](https://www.ruby-forum.com/u/Thomas_E_Enebo)\
**Replies:** 2\
**Last updated:** [April 30, 2010, 8:54pm UTC](https://www.ruby-forum.com/t/jruby-1-5-0-rc2-released/187760 "2010-04-30T20:54:02Z")

</div>

The JRuby community is pleased to announce the release of JRuby 1.5.0.RC2 Homepage: http://www.jruby.org/ Download: Downloads — JRuby.org This development cycle has been our longest cycle yet (nearly 5 months), bu…

---

## [Burn Audio CD](https://www.ruby-forum.com/t/burn-audio-cd/187482)

<div class="topic-metadata">

**Author:** [@quattro](https://www.ruby-forum.com/u/quattro)\
**Replies:** 3\
**Last updated:** [April 30, 2010, 8:43pm UTC](https://www.ruby-forum.com/t/burn-audio-cd/187482 "2010-04-30T20:43:44Z")

</div>

Is there an existing gem or library I can use to burn audio to a cd using ruby?

---

## [Method url](https://www.ruby-forum.com/t/method-url/197133)

<div class="topic-metadata">

**Author:** [@kevid](https://www.ruby-forum.com/u/kevid)\
**Replies:** 1\
**Last updated:** [April 30, 2010, 7:51pm UTC](https://www.ruby-forum.com/t/method-url/197133 "2010-04-30T19:51:22Z")

</div>

Hi all, Does anyone knows how to access a method’s url within the method for instance; def index – – #some code that will append a parameter to the url that will call the show method. show end def show url = (s…

---

## [JRuby and open-uri File handle issue](https://www.ruby-forum.com/t/jruby-and-open-uri-file-handle-issue/187857)

<div class="topic-metadata">

**Author:** [@homerlex](https://www.ruby-forum.com/u/homerlex)\
**Replies:** 3\
**Last updated:** [April 30, 2010, 6:39pm UTC](https://www.ruby-forum.com/t/jruby-and-open-uri-file-handle-issue/187857 "2010-04-30T18:39:08Z")

</div>

As stated in another thread we have been seeing the number of open file handles increase through out the day until Tomcat is restarted. We are using Rails 2.3.5 with Tomcat 5 OpenJDK 1.6.0-b09 and Jruby 1.4 on RHEL 5.…

---

## [Use of STDOUT.flush after puts](https://www.ruby-forum.com/t/use-of-stdout-flush-after-puts/187740)

<div class="topic-metadata">

**Author:** [@alexd](https://www.ruby-forum.com/u/alexd)\
**Replies:** 21\
**Last updated:** [April 30, 2010, 6:06pm UTC](https://www.ruby-forum.com/t/use-of-stdout-flush-after-puts/187740 "2010-04-30T18:06:35Z")

</div>

I’ve seen several examples on this forum where folks have used STDOUT.flush after printing a query to a terminal. For example: puts “Delete indicated item \[yes, no\]” STDOUT.flush response = gets.chomp What is the p…

---

## [Need informations](https://www.ruby-forum.com/t/need-informations/187864)

<div class="topic-metadata">

**Author:** [@doctor](https://www.ruby-forum.com/u/doctor)\
**Replies:** 1\
**Last updated:** [April 30, 2010, 5:37pm UTC](https://www.ruby-forum.com/t/need-informations/187864 "2010-04-30T17:37:53Z")

</div>

I need some informations about the scripting with Ruby. Is it possible to do this feature directly (or indirectly) : - manage processus (start, get the status, stop), - get the return of a program, - get the program …

---

## [Switching dynamically between methods (inside modules)](https://www.ruby-forum.com/t/switching-dynamically-between-methods-inside-modules/187850)

<div class="topic-metadata">

**Author:** [@judge](https://www.ruby-forum.com/u/judge)\
**Replies:** 8\
**Last updated:** [April 30, 2010, 3:46pm UTC](https://www.ruby-forum.com/t/switching-dynamically-between-methods-inside-modules/187850 "2010-04-30T15:46:34Z")

</div>

Hi, I would like to allow a person object (instanced from a Person class) to speak a language (which is a collection of public methods stored in Language module): class Person attr\_accessor :current\_language def …

---

## [Trying to clone the jruby repository](https://www.ruby-forum.com/t/trying-to-clone-the-jruby-repository/187859)

<div class="topic-metadata">

**Author:** [@Jay\_McGaffigan](https://www.ruby-forum.com/u/Jay_McGaffigan)\
**Replies:** 3\
**Last updated:** [April 30, 2010, 3:44pm UTC](https://www.ruby-forum.com/t/trying-to-clone-the-jruby-repository/187859 "2010-04-30T15:44:14Z")

</div>

I was trying to git clone jruby and I always get the following: git clone GitHub - jruby/jruby: JRuby, an implementation of Ruby on the JVM Initialized empty Git repository in /Users/home/Projects/jruby/jruby/.git/ g…

---

## [Besoins d'infos](https://www.ruby-forum.com/t/besoins-dinfos/187858)

<div class="topic-metadata">

**Author:** [@doctor](https://www.ruby-forum.com/u/doctor)\
**Replies:** 1\
**Last updated:** [April 30, 2010, 3:40pm UTC](https://www.ruby-forum.com/t/besoins-dinfos/187858 "2010-04-30T15:40:37Z")

</div>

J’aurais besoin de quelques infos au sujet du scripting par ruby. Est-il possible de maniÃ¨re directe (ou par des utilitaires ?) de : - gÃ©rer les processus (start, rÃ©cupÃ©rer le status, stop), - gestion des codes re…

---

## [Encrypting files in Ruby](https://www.ruby-forum.com/t/encrypting-files-in-ruby/187824)

<div class="topic-metadata">

**Author:** [@demec](https://www.ruby-forum.com/u/demec)\
**Replies:** 1\
**Last updated:** [April 30, 2010, 9:57am UTC](https://www.ruby-forum.com/t/encrypting-files-in-ruby/187824 "2010-04-30T09:57:40Z")

</div>

So far the tutorials I’ve seen are for encrypting text and then decrypting it back. So for example you have a plaintext = “some text” you encrypt it and the you decrypt it depending on how you encrypted it. What I …

---

## [Precompiling Ruby...completely](https://www.ruby-forum.com/t/precompiling-ruby-completely/187844)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 0\
**Last updated:** [April 30, 2010, 9:17am UTC](https://www.ruby-forum.com/t/precompiling-ruby-completely/187844 "2010-04-30T09:17:17Z")

</div>

I wrote up a blog post about my evening’s experiments precompiling Ruby to JVM bytecode: The short of it is that I’ve added --sha1 and --handles flags to jrubyc (on master only…we need to talk about whether it shoul…

---

## [RubyKaigi 2010: Early Call for Sub-Event Proposals](https://www.ruby-forum.com/t/rubykaigi-2010-early-call-for-sub-event-proposals/184336)

<div class="topic-metadata">

**Author:** [@Leonard\_C](https://www.ruby-forum.com/u/Leonard_C)\
**Replies:** 2\
**Last updated:** [April 30, 2010, 7:26am UTC](https://www.ruby-forum.com/t/rubykaigi-2010-early-call-for-sub-event-proposals/184336 "2010-04-30T07:26:05Z")

</div>

RubyKaigi is seeking sub-event proposals for RubyKaigi 2010 \[\[日本Ruby会議 2010, 8月27日〜29日\]\]. If you have an idea that doesn’t fit the usual “presentation” format and would like to run it as part of RubyKaigi 2010 in Tsuk…

---

## [Rubygems under linux](https://www.ruby-forum.com/t/rubygems-under-linux/187836)

<div class="topic-metadata">

**Author:** [@carlwenrich](https://www.ruby-forum.com/u/carlwenrich)\
**Replies:** 1\
**Last updated:** [April 30, 2010, 5:16am UTC](https://www.ruby-forum.com/t/rubygems-under-linux/187836 "2010-04-30T05:16:09Z")

</div>

I got ruby installed. I got rubygems installed, and these messages confirmed success: RubyGems 1.3.6 installed RubyGems installed the following executables: /usr/local/bin/gem but when I run gem list, I get this: /…

---

## [Ruby's %x{} -- running system commands](https://www.ruby-forum.com/t/rubys-x-running-system-commands/187829)

<div class="topic-metadata">

**Author:** [@dewie](https://www.ruby-forum.com/u/dewie)\
**Replies:** 1\
**Last updated:** [April 30, 2010, 2:20am UTC](https://www.ruby-forum.com/t/rubys-x-running-system-commands/187829 "2010-04-30T02:20:00Z")

</div>

The command I execute within %x{…}, if executed on the command line, works perfectly, every time. If I run the same command within Ruby’s %x{…}, I get mixed results. Sometimes a blank string, other times the expected …

---

## [Hijacking \`super'](https://www.ruby-forum.com/t/hijacking-super/187822)

<div class="topic-metadata">

**Author:** [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Replies:** 2\
**Last updated:** [April 30, 2010, 2:18am UTC](https://www.ruby-forum.com/t/hijacking-super/187822 "2010-04-30T02:18:50Z")

</div>

I know the following is probably impossible, but I just thought I’d ping the list to see if any adventurous meta programmer knows of a way to essentially change the binding of a block. Here’s essentially what I’m tryi…

---

## [Debugging ironruby code hosted by a c# app](https://www.ruby-forum.com/t/debugging-ironruby-code-hosted-by-a-c-app/187826)

<div class="topic-metadata">

**Author:** [@smolina74](https://www.ruby-forum.com/u/smolina74)\
**Replies:** 2\
**Last updated:** [April 30, 2010, 2:11am UTC](https://www.ruby-forum.com/t/debugging-ironruby-code-hosted-by-a-c-app/187826 "2010-04-30T02:11:12Z")

</div>

I’m experimenting a little with ironruby and I just want to know if there’s any way to debug ironruby code that is hosted by a c# windows app. Any ideas? thanks, Santiago

---

## [Code refactoring: request for comment](https://www.ruby-forum.com/t/code-refactoring-request-for-comment/187823)

<div class="topic-metadata">

**Author:** [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Replies:** 1\
**Last updated:** [April 30, 2010, 12:26am UTC](https://www.ruby-forum.com/t/code-refactoring-request-for-comment/187823 "2010-04-30T00:26:26Z")

</div>

Hi all, I’ve just finished doing some pretty heavy refactoring on a method. I’d like to know if anyone can offer any suggestions or feedback. This is the old one: This is the new one: In short, I am parsing an SGF…

---

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

<div class="topic-metadata">

**Author:** [@svin80](https://www.ruby-forum.com/u/svin80)\
**Replies:** 2\
**Last updated:** [April 29, 2010, 9:01pm UTC](https://www.ruby-forum.com/t/ruby-require-local-file-problem/187814 "2010-04-29T21:01:35Z")

</div>

I have two files foo.rb and test.rb in the same folder. test.rb puts RUBY\_VERSION require ‘foo’ foo.rb module Foo PATTT = “2323” class Foo2 def f puts ‘hello world’ end end end puts ‘eee’ Running under NetBeans…

---

## [Flt gem for arbitrary precision](https://www.ruby-forum.com/t/flt-gem-for-arbitrary-precision/187728)

<div class="topic-metadata">

**Author:** [@giampiz](https://www.ruby-forum.com/u/giampiz)\
**Replies:** 6\
**Last updated:** [April 29, 2010, 8:51pm UTC](https://www.ruby-forum.com/t/flt-gem-for-arbitrary-precision/187728 "2010-04-29T20:51:00Z")

</div>

ciao a tutti (hi to hall) I just discoverd a gem to have arbitrary precision numbers and want to share with the forum. Install the gem with gem install flt an example script follows; it computes the square root of 2 …

---

## [Requiring a compiled class file from within a Jar using RedBridge](https://www.ruby-forum.com/t/requiring-a-compiled-class-file-from-within-a-jar-using-redbridge/187329)

<div class="topic-metadata">

**Author:** [@Benjamin\_Christenso](https://www.ruby-forum.com/u/Benjamin_Christenso)\
**Replies:** 8\
**Last updated:** [April 29, 2010, 8:39pm UTC](https://www.ruby-forum.com/t/requiring-a-compiled-class-file-from-within-a-jar-using-redbridge/187329 "2010-04-29T20:39:53Z")

</div>

Hello everyone, We recently encountered a bug executing one of our JRuby applications (which we execute via RedBridge from within a Tomcat 5.5 context). The application works in Windows, but throws an exception fro…

---

## [Formal methods](https://www.ruby-forum.com/t/formal-methods/187007)

<div class="topic-metadata">

**Author:** [@lykos](https://www.ruby-forum.com/u/lykos)\
**Replies:** 10\
**Last updated:** [April 29, 2010, 6:43pm UTC](https://www.ruby-forum.com/t/formal-methods/187007 "2010-04-29T18:43:58Z")

</div>

Hi, I want to try to prove some parts of my programs formally. Does anyone have any experience with the combination of formal methods and Ruby?

---

## [Navigate through folders](https://www.ruby-forum.com/t/navigate-through-folders/187733)

<div class="topic-metadata">

**Author:** [@brunik](https://www.ruby-forum.com/u/brunik)\
**Replies:** 5\
**Last updated:** [April 29, 2010, 6:31pm UTC](https://www.ruby-forum.com/t/navigate-through-folders/187733 "2010-04-29T18:31:05Z")

</div>

Hello everyone, ok… I have file (file.txt) which is written by a script. In this given file there’s a path (c:/path/path1/path2) and I have the following code in another script: File.open(‘file.txt’).each\_line do |p| …

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

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