# Ruby

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

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

---

## [Require behaviour](https://www.ruby-forum.com/t/require-behaviour/160065)

<div class="topic-metadata">

**Author:** [@manimaran](https://www.ruby-forum.com/u/manimaran)\
**Replies:** 2\
**Last updated:** [February 11, 2009, 1:44pm UTC](https://www.ruby-forum.com/t/require-behaviour/160065 "2009-02-11T13:44:50Z")

</div>

Dear folks, I’m new to ruby, Please explain the following snippet’s behavior def require( \*packages ) packages.each{ | pack | super( pack ); } end require(‘rubygems’,‘actionmailer’)

---

## [Host Webrick servlets with Apache FastCGI?](https://www.ruby-forum.com/t/host-webrick-servlets-with-apache-fastcgi/160052)

<div class="topic-metadata">

**Author:** [@Andrew\_SSTownley](https://www.ruby-forum.com/u/Andrew_SSTownley)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 10:40am UTC](https://www.ruby-forum.com/t/host-webrick-servlets-with-apache-fastcgi/160052 "2009-02-11T10:40:11Z")

</div>

Hi folks, Been away from the list for a while, but I can’t seem to find a good answer to this with google. I’m looking at deploying some ruby Web functionality, and I’d like to be able to write it as a Webrick servle…

---

## [Sanity check on File.dirname](https://www.ruby-forum.com/t/sanity-check-on-file-dirname/160002)

<div class="topic-metadata">

**Author:** [@danielb](https://www.ruby-forum.com/u/danielb)\
**Replies:** 1\
**Last updated:** [February 11, 2009, 10:24am UTC](https://www.ruby-forum.com/t/sanity-check-on-file-dirname/160002 "2009-02-11T10:24:18Z")

</div>

Hi, I need a quick sanity check. Excepting potential backslashes for the moment, aren’t these two identical? File.dirname(path).split(’/’)\[0…-2\].join(’/’) File.dirname(File.dirname(path)) Dan

---

## [FixNum#times is correct?](https://www.ruby-forum.com/t/fixnum-times-is-correct/160042)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 4\
**Last updated:** [February 11, 2009, 9:42am UTC](https://www.ruby-forum.com/t/fixnum-times-is-correct/160042 "2009-02-11T09:42:29Z")

</div>

irb\> 5.times {|i| puts i} 0 1 2 3 4 5 Is it the expected output? I was expecting: 0 1 2 3 4

---

## [Problem with mysql gem installation](https://www.ruby-forum.com/t/problem-with-mysql-gem-installation/160041)

<div class="topic-metadata">

**Author:** [@fannus](https://www.ruby-forum.com/u/fannus)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 8:32am UTC](https://www.ruby-forum.com/t/problem-with-mysql-gem-installation/160041 "2009-02-11T08:32:02Z")

</div>

Hi. So, I reached the point in my learning Ruby where I’d like to start doing work with actual web applications. My server, setup in Debian Lenny (Unstable), doesn’t seem to like the MySQL gem: Upon researching it, I …

---

## [Interval based program](https://www.ruby-forum.com/t/interval-based-program/160033)

<div class="topic-metadata">

**Author:** [@balavrscse](https://www.ruby-forum.com/u/balavrscse)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 6:09am UTC](https://www.ruby-forum.com/t/interval-based-program/160033 "2009-02-11T06:09:42Z")

</div>

Hi Guys, I am newbie to Ruby P.ming Language. I want to send mail to the service providers frequently.time will be set by service providers. We have 100 different service providers, each of them will set their own ti…

---

## [How to reduce your electricity bill](https://www.ruby-forum.com/t/how-to-reduce-your-electricity-bill/160031)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 1\
**Last updated:** [February 11, 2009, 6:08am UTC](https://www.ruby-forum.com/t/how-to-reduce-your-electricity-bill/160031 "2009-02-11T06:08:41Z")

</div>

How to reduce your electricity bill If you have been bogged by the enormous electricity bills you have been getting, it is time to take some concrete steps. You can reduce your electricity bills by following very simp…

---

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

<div class="topic-metadata">

**Author:** [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Replies:** 2\
**Last updated:** [February 11, 2009, 4:29am UTC](https://www.ruby-forum.com/t/code-review-bugfixes1/160025 "2009-02-11T04:29:14Z")

</div>

tfpt review “/shelveset:bugfixes1;REDMOND\\jdeville” Comment : BinaryEncoding changes to help mono compilation, thanks to M. Letterle. Changes in FileOps to fix File.dirname (Rubyforge bugs 23669 and 22167), thanks t…

---

## [Calling class method from instance](https://www.ruby-forum.com/t/calling-class-method-from-instance/159979)

<div class="topic-metadata">

**Author:** [@Larz](https://www.ruby-forum.com/u/Larz)\
**Replies:** 5\
**Last updated:** [February 11, 2009, 2:04am UTC](https://www.ruby-forum.com/t/calling-class-method-from-instance/159979 "2009-02-11T02:04:10Z")

</div>

I was puzzled on this but figured out a way to do it. Figured I’d post it on here, maybe there’s a better way … class Test @c = 2 def self.ctest puts @c end def initialize(i) @i = i end def itest puts @i here…

---

## [GC and Threads](https://www.ruby-forum.com/t/gc-and-threads/160017)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 4\
**Last updated:** [February 11, 2009, 1:56am UTC](https://www.ruby-forum.com/t/gc-and-threads/160017 "2009-02-11T01:56:33Z")

</div>

I’m trying to prove two simple facts about how Ruby works: Ruby can GC a Thread that has run to completion if you no longer have any references to it, even if the value() have never been collected Ruby cannot GC a run…

---

## [Ruby interpreter written in ruby](https://www.ruby-forum.com/t/ruby-interpreter-written-in-ruby/159752)

<div class="topic-metadata">

**Author:** [@Eelco](https://www.ruby-forum.com/u/Eelco)\
**Replies:** 12\
**Last updated:** [February 11, 2009, 1:47am UTC](https://www.ruby-forum.com/t/ruby-interpreter-written-in-ruby/159752 "2009-02-11T01:47:46Z")

</div>

Hi there, I am new to programming and ruby… Trying to read through the pickaxe and do the exercises on Sphere Online Judge. I was wondering is there a ruby written ruby interpreter available? somehow i\`d like to be a…

---

## [Which is the best development environment? Windows Vs Linux](https://www.ruby-forum.com/t/which-is-the-best-development-environment-windows-vs-linux/196894)

<div class="topic-metadata">

**Author:** [@priyankeshu](https://www.ruby-forum.com/u/priyankeshu)\
**Replies:** 13\
**Last updated:** [February 11, 2009, 1:12am UTC](https://www.ruby-forum.com/t/which-is-the-best-development-environment-windows-vs-linux/196894 "2009-02-11T01:12:05Z")

</div>

I just started learnign Rails and i think it’s quite cool! I have just done some basic stuff till now i was talking to some professional guy who was working in ruby On Rails for last 1 year and he said that it would b…

---

## [Mathematical Image Generator (#191)](https://www.ruby-forum.com/t/mathematical-image-generator-191/159648)

<div class="topic-metadata">

**Author:** [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Replies:** 10\
**Last updated:** [February 11, 2009, 12:01am UTC](https://www.ruby-forum.com/t/mathematical-image-generator-191/159648 "2009-02-11T00:01:16Z")

</div>

\-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have elapsed from the time this m…

---

## [Problem running mephisto 0.8.1 with glassfish prelude v3](https://www.ruby-forum.com/t/problem-running-mephisto-0-8-1-with-glassfish-prelude-v3/159960)

<div class="topic-metadata">

**Author:** [@skiz](https://www.ruby-forum.com/u/skiz)\
**Replies:** 2\
**Last updated:** [February 10, 2009, 11:40pm UTC](https://www.ruby-forum.com/t/problem-running-mephisto-0-8-1-with-glassfish-prelude-v3/159960 "2009-02-10T23:40:46Z")

</div>

Hi, I am setting my blog using Mephisto 0.8.1, jruby 1.1.6 and glassfish version 3. Whenever I go to the admin section of the blog and then go to the settings page I get the error below. The weird thing is that wh…

---

## [Jruby daemon gem/plugin](https://www.ruby-forum.com/t/jruby-daemon-gem-plugin/159947)

<div class="topic-metadata">

**Author:** [@skiz](https://www.ruby-forum.com/u/skiz)\
**Replies:** 1\
**Last updated:** [February 10, 2009, 11:40pm UTC](https://www.ruby-forum.com/t/jruby-daemon-gem-plugin/159947 "2009-02-10T23:40:10Z")

</div>

Hi, I am working to convert a ruby application to using JRuby (I want to use JMX to monitor a remote process). I am stuck because the original application uses the daemons gem and plugin. It seams like the daemons …

---

## [Re: test .net code with ruby BDD libraries](https://www.ruby-forum.com/t/re-test-net-code-with-ruby-bdd-libraries/159971)

<div class="topic-metadata">

**Author:** [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Replies:** 1\
**Last updated:** [February 10, 2009, 11:17pm UTC](https://www.ruby-forum.com/t/re-test-net-code-with-ruby-bdd-libraries/159971 "2009-02-10T23:17:51Z")

</div>

Hi Ivan, It is a very good documentation of what we have now. I have been playing with Ironruby and becon couldn’t make it work. I am going to give it a try with your suggestion. Thanks for the help. — On Tue, 2/10/…

---

## [String#split "feature"](https://www.ruby-forum.com/t/string-split-feature/160006)

<div class="topic-metadata">

**Author:** [@gyngve](https://www.ruby-forum.com/u/gyngve)\
**Replies:** 3\
**Last updated:** [February 10, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/string-split-feature/160006 "2009-02-10T23:15:30Z")

</div>

Just got bitten by some functionality of split w/ grouped patterns: (in ruby 1.8.6…) “foo bar baz”.split(/bar/) =\> \["foo “, " baz”\] “foo bar baz”.split(/(bar)/) =\> \["foo “, “bar”, " baz”\] The 1.8 docs are sil…

---

## [Counting Occurrences of a String in an Array](https://www.ruby-forum.com/t/counting-occurrences-of-a-string-in-an-array/160011)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [February 10, 2009, 11:13pm UTC](https://www.ruby-forum.com/t/counting-occurrences-of-a-string-in-an-array/160011 "2009-02-10T23:13:06Z")

</div>

Hi, I’m pretty new to Ruby, and I’ve been trying to figure out the best way to do this with little luck. I have an array that is all strings, and I need to count, for each string in the array, how many times some sub…

---

## [Regex to escape special characters](https://www.ruby-forum.com/t/regex-to-escape-special-characters/159989)

<div class="topic-metadata">

**Author:** [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Replies:** 4\
**Last updated:** [February 10, 2009, 7:50pm UTC](https://www.ruby-forum.com/t/regex-to-escape-special-characters/159989 "2009-02-10T19:50:01Z")

</div>

I’ve got the following string… “This is ( a test” And I want to do a regex gsub on it to turn it into… “This is ( a test” In irb, If I start with… “This is ( a test”.gsub(/\[(\]/,‘&’) =\> “This is ( a test” And…

---

## [Mutex](https://www.ruby-forum.com/t/mutex/159955)

<div class="topic-metadata">

**Author:** [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Replies:** 1\
**Last updated:** [February 10, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/mutex/159955 "2009-02-10T17:56:58Z")

</div>

I have more doutes on mutex.So I need Mutex concepts with more examples.

---

## [JRuby on Rails on Tomcat](https://www.ruby-forum.com/t/jruby-on-rails-on-tomcat/159975)

<div class="topic-metadata">

**Author:** [@uma07](https://www.ruby-forum.com/u/uma07)\
**Replies:** 0\
**Last updated:** [February 10, 2009, 4:43pm UTC](https://www.ruby-forum.com/t/jruby-on-rails-on-tomcat/159975 "2009-02-10T16:43:09Z")

</div>

I am working on a JRuby on Rails application. Its running fine in Glassfish application server. I have to host my JRuby application in tomcat6 server. I generated WAR file using warbler. When I deployed that WAR in to…

---

## [Question on installing gem upgrades](https://www.ruby-forum.com/t/question-on-installing-gem-upgrades/159974)

<div class="topic-metadata">

**Author:** [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Replies:** 0\
**Last updated:** [February 10, 2009, 4:28pm UTC](https://www.ruby-forum.com/t/question-on-installing-gem-upgrades/159974 "2009-02-10T16:28:32Z")

</div>

I have upgraded my gem watir 1.5.6 to 1.6.2 without removing 1.5.6. Do you think it will have an impact on the scripts choosing which gem to run? After upgrading watir the gem list shows both versions watir (1.5.6, 1.…

---

## [YAML + ASCII Encoded Unicode](https://www.ruby-forum.com/t/yaml-ascii-encoded-unicode/159910)

<div class="topic-metadata">

**Author:** [@corywilkerson](https://www.ruby-forum.com/u/corywilkerson)\
**Replies:** 1\
**Last updated:** [February 10, 2009, 2:55pm UTC](https://www.ruby-forum.com/t/yaml-ascii-encoded-unicode/159910 "2009-02-10T14:55:27Z")

</div>

Folks, Hopefully someone can help me fight through this, been spinning my wheels for the past eight hours an am making little traction (BTW, on 1.8, could possibly go to 1.9 if some of the file encoding facilities ma…

---

## [Simple HTTP Post Xml request](https://www.ruby-forum.com/t/simple-http-post-xml-request/159950)

<div class="topic-metadata">

**Author:** [@melmoth](https://www.ruby-forum.com/u/melmoth)\
**Replies:** 6\
**Last updated:** [February 10, 2009, 2:18pm UTC](https://www.ruby-forum.com/t/simple-http-post-xml-request/159950 "2009-02-10T14:18:00Z")

</div>

Hi, I’m trying to post a xml to a server for encoding a file (http://www.encoding.com/wdocs/SampleScripts). Basically I just need a simple HTTP post where I specify an xml. I’m trying to use Net::HTTP post but in my …

---

## [io.set\_encoding("UTF-8", "UTF-8") $B$G%(%i!\<(B](https://www.ruby-forum.com/t/io-set-encoding-utf-8-utf-8-b-g-i-b/159745)

<div class="topic-metadata">

**Author:** [@Hiroshi\_Ichikawa](https://www.ruby-forum.com/u/Hiroshi_Ichikawa)\
**Replies:** 1\
**Last updated:** [February 10, 2009, 2:00pm UTC](https://www.ruby-forum.com/t/io-set-encoding-utf-8-utf-8-b-g-i-b/159745 "2009-02-10T14:00:28Z")

</div>

Gimitee$B$H$$$$$^$9!#e(B Ruby 1.9.1e$B$Ge(B $stdin.set\_encoding(“UTF-8”, “UTF-8”) $stdin.gets() e$B$H$9$k$He(B test.rb:4:in gets': code converter not found (UTF-8 to UTF-8) (Encoding::ConverterNotFoundError) e$B$H8@…

---

## [Http to https redirect](https://www.ruby-forum.com/t/http-to-https-redirect/159957)

<div class="topic-metadata">

**Author:** [@rejikumarrv](https://www.ruby-forum.com/u/rejikumarrv)\
**Replies:** 4\
**Last updated:** [February 10, 2009, 12:57pm UTC](https://www.ruby-forum.com/t/http-to-https-redirect/159957 "2009-02-10T12:57:17Z")

</div>

hi all, Needed some help with http to https redirection. I have a requirement wherein the login page alone should have https enabled. ie the user name & password should be sent to server in encrypted form. Once the v…

---

## [Submit\_tag problem](https://www.ruby-forum.com/t/submit-tag-problem/159945)

<div class="topic-metadata">

**Author:** [@ganeshk](https://www.ruby-forum.com/u/ganeshk)\
**Replies:** 1\
**Last updated:** [February 10, 2009, 12:35pm UTC](https://www.ruby-forum.com/t/submit-tag-problem/159945 "2009-02-10T12:35:34Z")

</div>

hi is it possible to use submit\_tag without form …

---

## [How to implement a C# interface from Ruby?](https://www.ruby-forum.com/t/how-to-implement-a-c-interface-from-ruby/159925)

<div class="topic-metadata">

**Author:** [@thbar](https://www.ruby-forum.com/u/thbar)\
**Replies:** 6\
**Last updated:** [February 10, 2009, 12:30pm UTC](https://www.ruby-forum.com/t/how-to-implement-a-c-interface-from-ruby/159925 "2009-02-10T12:30:16Z")

</div>

Hello again, I’m playing around with the idea of using IronRuby to implement plugins for a C#-based system (namely, CruiseControl.Net). I’m having some difficulties trying to figure out what the correct syntax for …

---

## [SOAP WSDLDriverFactory header params](https://www.ruby-forum.com/t/soap-wsdldriverfactory-header-params/159882)

<div class="topic-metadata">

**Author:** [@sshingler](https://www.ruby-forum.com/u/sshingler)\
**Replies:** 1\
**Last updated:** [February 10, 2009, 10:38am UTC](https://www.ruby-forum.com/t/soap-wsdldriverfactory-header-params/159882 "2009-02-10T10:38:31Z")

</div>

Hi all, I have a little bit of code which uses the WSDLDriverFactory library: class Swrapper def initialize(wsdl) wsdl = SOAP::WSDLDriverFactory.new(wsdl) @soap = wsdl.create\_rpc\_driver end def send\_soap(method, p…

---

## [Search latest version of file in directory](https://www.ruby-forum.com/t/search-latest-version-of-file-in-directory/159895)

<div class="topic-metadata">

**Author:** [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Replies:** 2\
**Last updated:** [February 10, 2009, 9:50am UTC](https://www.ruby-forum.com/t/search-latest-version-of-file-in-directory/159895 "2009-02-10T09:50:18Z")

</div>

Hi, I have a directory full of files and want to get the newest version of each out of the directory. The files look like below. Please tell me if you know a way to pull out the latest version of each. Thanks 34\_web1\_…

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

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