# Ruby

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

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

---

## [Dealing with old types](https://www.ruby-forum.com/t/dealing-with-old-types/48250)

<div class="topic-metadata">

**Author:** [@richard.mcgrath](https://www.ruby-forum.com/u/richard.mcgrath)\
**Replies:** 1\
**Last updated:** [November 18, 2005, 5:13pm UTC](https://www.ruby-forum.com/t/dealing-with-old-types/48250 "2005-11-18T17:13:27Z")

</div>

Hi, I often have tables that refernce a sub-table that contain types. e.g. an addresses table might have a field called “address\_type\_id” that references a single row in the “address\_types” table. When I display thi…

---

## [Time.yesterday :)](https://www.ruby-forum.com/t/time-yesterday/48192)

<div class="topic-metadata">

**Author:** [@mj-usunto](https://www.ruby-forum.com/u/mj-usunto)\
**Replies:** 15\
**Last updated:** [November 18, 2005, 5:04pm UTC](https://www.ruby-forum.com/t/time-yesterday/48192 "2005-11-18T17:04:23Z")

</div>

Hello group. Is there any simple method to get Time object like Time.now but with yesterday date, without worrying about end of month or begining new one ?

---

## [Proposed RCR: Object#replace](https://www.ruby-forum.com/t/proposed-rcr-object-replace/48095)

<div class="topic-metadata">

**Author:** [@halostatue](https://www.ruby-forum.com/u/halostatue)\
**Replies:** 23\
**Last updated:** [November 18, 2005, 4:55pm UTC](https://www.ruby-forum.com/t/proposed-rcr-object-replace/48095 "2005-11-18T16:55:20Z")

</div>

On the Sydney list, Daniel B. has been asking about a generic Object#replace call to work similarly to Hash#replace, String#replace, and Array#replace. I see no reason that this could not be implemented for all object…

---

## [IO.lineno= not behaving as expected](https://www.ruby-forum.com/t/io-lineno-not-behaving-as-expected/48291)

<div class="topic-metadata">

**Author:** [@belorion](https://www.ruby-forum.com/u/belorion)\
**Replies:** 4\
**Last updated:** [November 18, 2005, 4:49pm UTC](https://www.ruby-forum.com/t/io-lineno-not-behaving-as-expected/48291 "2005-11-18T16:49:18Z")

</div>

What am I missing here (apologies if this is just my 7am brain fog speaking): The contents of my file (test) are: 1 2 3 4 5 6 f = File.open(‘test’) f.lineno = 4 puts f.readline # \<= This returns 1, instead of …

---

## [Keyword arguments like grandma makes 'em](https://www.ruby-forum.com/t/keyword-arguments-like-grandma-makes-em/48184)

<div class="topic-metadata">

**Author:** [@transfire](https://www.ruby-forum.com/u/transfire)\
**Replies:** 13\
**Last updated:** [November 18, 2005, 4:49pm UTC](https://www.ruby-forum.com/t/keyword-arguments-like-grandma-makes-em/48184 "2005-11-18T16:49:18Z")

</div>

I’m messing around with some methods trying to figure out how to offer all the functionality I want in a clean interface and I stumbled across an idea that may be better for keyword arguments. Instead of grab ‘x’, :f…

---

## [Foreign keys in Ruby on Rails](https://www.ruby-forum.com/t/foreign-keys-in-ruby-on-rails/48285)

<div class="topic-metadata">

**Author:** [@spambak](https://www.ruby-forum.com/u/spambak)\
**Replies:** 1\
**Last updated:** [November 18, 2005, 4:46pm UTC](https://www.ruby-forum.com/t/foreign-keys-in-ruby-on-rails/48285 "2005-11-18T16:46:44Z")

</div>

Should the foreign key constraints only be declared in the Model code of the application, or in both the code and the database?

---

## [Ri erratum: Marshal#dump](https://www.ruby-forum.com/t/ri-erratum-marshal-dump/48278)

<div class="topic-metadata">

**Author:** [@martindemello](https://www.ruby-forum.com/u/martindemello)\
**Replies:** 0\
**Last updated:** [November 18, 2005, 3:24pm UTC](https://www.ruby-forum.com/t/ri-erratum-marshal-dump/48278 "2005-11-18T15:24:22Z")

</div>

ri refers to Marshal#dump rather than the correct Marshal.dump (ruby 1.8.4). martin

---

## [Step by step tutorial on using emacs with Ruby](https://www.ruby-forum.com/t/step-by-step-tutorial-on-using-emacs-with-ruby/49485)

<div class="topic-metadata">

**Author:** [@anne](https://www.ruby-forum.com/u/anne)\
**Replies:** 8\
**Last updated:** [November 18, 2005, 3:15pm UTC](https://www.ruby-forum.com/t/step-by-step-tutorial-on-using-emacs-with-ruby/49485 "2005-11-18T15:15:18Z")

</div>

I downloaded emacs from http://home.att.ne.jp/alpha/z123/emacs-mac-e.html It said that ruby was installed. I have spent two hours searching this list and the web, and I cannot find any tutorial telling beginners what…

---

## [Ruby-ldap, invalid credentials](https://www.ruby-forum.com/t/ruby-ldap-invalid-credentials/48209)

<div class="topic-metadata">

**Author:** [@Daniel.Berger](https://www.ruby-forum.com/u/Daniel.Berger)\
**Replies:** 2\
**Last updated:** [November 18, 2005, 2:48pm UTC](https://www.ruby-forum.com/t/ruby-ldap-invalid-credentials/48209 "2005-11-18T14:48:06Z")

</div>

Hi all, Another ldap newb question. I can’t seem to bind to the ldap server with a password. For example, this works: ldaptest.rb require “ldap” ldap\_server = “ldap.foo.com” password = “XXX” ldap = LDAP::Conn…

---

## [Problems installing rails](https://www.ruby-forum.com/t/problems-installing-rails/48261)

<div class="topic-metadata">

**Author:** [@JensRie](https://www.ruby-forum.com/u/JensRie)\
**Replies:** 2\
**Last updated:** [November 18, 2005, 1:35pm UTC](https://www.ruby-forum.com/t/problems-installing-rails/48261 "2005-11-18T13:35:28Z")

</div>

Hello, I’m just trying to install the rails framework on my Windows XP system and have some problems at the start: According to the tutorial I open my command prompt and enter the following: gem install rails --remo…

---

## [Problem with rio-0.3.4](https://www.ruby-forum.com/t/problem-with-rio-0-3-4/48273)

<div class="topic-metadata">

**Author:** [@wybo](https://www.ruby-forum.com/u/wybo)\
**Replies:** 0\
**Last updated:** [November 18, 2005, 12:34pm UTC](https://www.ruby-forum.com/t/problem-with-rio-0-3-4/48273 "2005-11-18T12:34:56Z")

</div>

Running this script (named riotest) with rio-0.3.3: require ‘rubygems’ require ‘rio’ puts rio(‘riotest’).readlines correctly says: wybo\>ruby riotest require ‘rubygems’ require ‘rio’ puts rio(‘riotest’).readlines …

---

## [.yml/host: localhost fails in Rails app generation](https://www.ruby-forum.com/t/yml-host-localhost-fails-in-rails-app-generation/48223)

<div class="topic-metadata">

**Author:** [@NoOne](https://www.ruby-forum.com/u/NoOne)\
**Replies:** 6\
**Last updated:** [November 18, 2005, 11:19am UTC](https://www.ruby-forum.com/t/yml-host-localhost-fails-in-rails-app-generation/48223 "2005-11-18T11:19:31Z")

</div>

I’m running mysql Ver 14.12 Distrib 5.0.15, for Win32 (ia32) on a WinXP/SP2 system. I’m trying to build the Depot application described in Chap. 5 of Agile Web Dev. w. Rails, © 2005. The generated database.yml fil…

---

## [London Ruby Users Group meeting - 23 Nov](https://www.ruby-forum.com/t/london-ruby-users-group-meeting-23-nov/48583)

<div class="topic-metadata">

**Author:** [@rob.02004](https://www.ruby-forum.com/u/rob.02004)\
**Replies:** 0\
**Last updated:** [November 18, 2005, 11:19am UTC](https://www.ruby-forum.com/t/london-ruby-users-group-meeting-23-nov/48583 "2005-11-18T11:19:31Z")

</div>

\*\* London Ruby U. Group Meeting \*\* Date: Wed 23 Nov Time: 7pm Location: office near Holborn tube exact address to be announced on LRUG list Tiest will present a summary of what happened at RubyConf 2005. Fo…

---

## [Problem after rails upgrade](https://www.ruby-forum.com/t/problem-after-rails-upgrade/48259)

<div class="topic-metadata">

**Author:** [@jason.wold](https://www.ruby-forum.com/u/jason.wold)\
**Replies:** 1\
**Last updated:** [November 18, 2005, 9:45am UTC](https://www.ruby-forum.com/t/problem-after-rails-upgrade/48259 "2005-11-18T09:45:34Z")

</div>

After upgrading rails (via gem update) I am getting a const\_missing error. $ rails foo /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active\_support/dependencies.rb:200:in const\_missing': uninitialized constant …

---

## [RDoc questions](https://www.ruby-forum.com/t/rdoc-questions/102479)

<div class="topic-metadata">

**Author:** [@listrecv](https://www.ruby-forum.com/u/listrecv)\
**Replies:** 2\
**Last updated:** [November 18, 2005, 4:17am UTC](https://www.ruby-forum.com/t/rdoc-questions/102479 "2005-11-18T04:17:02Z")

</div>

I think RDoc is great. Three questions: How do I put RDoc’s for an attribute? Is there a way to tell RDoc to include htmlized source of the entire file as well (not the just the popup source - the entire file) - …

---

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

<div class="topic-metadata">

**Author:** [@gregarican](https://www.ruby-forum.com/u/gregarican)\
**Replies:** 1\
**Last updated:** [November 18, 2005, 3:04am UTC](https://www.ruby-forum.com/t/ruby-visibility/48198 "2005-11-18T03:04:46Z")

</div>

I was pleasantly surprised today to drop by the Barnes and Noble booktstore next to my workplace and find two Ruby books on the shelf. One was Pickaxe2 and the other was the Agile Rails book. Compared with some other …

---

## [Re: officeofgreatideas.com](https://www.ruby-forum.com/t/re-officeofgreatideas-com/48532)

<div class="topic-metadata">

**Author:** [@daniels](https://www.ruby-forum.com/u/daniels)\
**Replies:** 0\
**Last updated:** [November 18, 2005, 1:10am UTC](https://www.ruby-forum.com/t/re-officeofgreatideas-com/48532 "2005-11-18T01:10:15Z")

</div>

The statement \[one pressing issue is a bug in the create controller that fails to store files that I attempt to upload\] leads me to believe that this is a probably a rails app… -----Original Message----- From: Lynd…

---

## [Improving code](https://www.ruby-forum.com/t/improving-code/67630)

<div class="topic-metadata">

**Author:** [@joevandyk](https://www.ruby-forum.com/u/joevandyk)\
**Replies:** 9\
**Last updated:** [November 18, 2005, 12:51am UTC](https://www.ruby-forum.com/t/improving-code/67630 "2005-11-18T00:51:41Z")

</div>

It should be fairly obvious as to what I’m doing (getting information about a process – right now just cpu percentage). Any ideas on how I can improve this code? I’m not a big fan of how the scanf stuff works. This …

---

## [Help needed with Ruby on Rails](https://www.ruby-forum.com/t/help-needed-with-ruby-on-rails/48139)

<div class="topic-metadata">

**Author:** [@jl\_post](https://www.ruby-forum.com/u/jl_post)\
**Replies:** 2\
**Last updated:** [November 18, 2005, 12:33am UTC](https://www.ruby-forum.com/t/help-needed-with-ruby-on-rails/48139 "2005-11-18T00:33:58Z")

</div>

Dear Ruby community, I need some help (hopefully just a little) installing and using Ruby on Rails. I’m fairly new to both Ruby and Rails, so I am following the steps mentioned in the book “Agile Web D. with Rails” (…

---

## [Re: Object#to\_b](https://www.ruby-forum.com/t/re-object-to-b/48398)

<div class="topic-metadata">

**Author:** [@daniels](https://www.ruby-forum.com/u/daniels)\
**Replies:** 10\
**Last updated:** [November 17, 2005, 9:05pm UTC](https://www.ruby-forum.com/t/re-object-to-b/48398 "2005-11-17T21:05:04Z")

</div>

The actual need for an Object#to\_b is that there’s no way to make your own custom object that will behave in a false/nil manner. I can’t think of a usecase where I’d want to put extra information into a nil/false obje…

---

## [Serializing an instance with arbitrary methods (in rails)](https://www.ruby-forum.com/t/serializing-an-instance-with-arbitrary-methods-in-rails/48195)

<div class="topic-metadata">

**Author:** [@gavin](https://www.ruby-forum.com/u/gavin)\
**Replies:** 7\
**Last updated:** [November 17, 2005, 8:46pm UTC](https://www.ruby-forum.com/t/serializing-an-instance-with-arbitrary-methods-in-rails/48195 "2005-11-17T20:46:55Z")

</div>

(I know there’s a rails mailing list. For some reason this feels more appropriate to ruby-talk. I’ll go to the other ML if this one fails :slight\_smile: Summary: I’m writing a rails app where I want to save informatio…

---

## [Gem and stubs](https://www.ruby-forum.com/t/gem-and-stubs/102483)

<div class="topic-metadata">

**Author:** [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Replies:** 4\
**Last updated:** [November 17, 2005, 7:55pm UTC](https://www.ruby-forum.com/t/gem-and-stubs/102483 "2005-11-17T19:55:34Z")

</div>

what’s the deal? does it support them or not? the docs are confusing on the matter, but the latest certainly does not support them by default and also no longer accepts the --install-stubs option. -a

---

## [Nihongo Benkyo 0.3](https://www.ruby-forum.com/t/nihongo-benkyo-0-3/100054)

<div class="topic-metadata">

**Author:** [@mblondel](https://www.ruby-forum.com/u/mblondel)\
**Replies:** 5\
**Last updated:** [November 17, 2005, 7:34pm UTC](https://www.ruby-forum.com/t/nihongo-benkyo-0-3/100054 "2005-11-17T19:34:15Z")

</div>

Hi all, I’m pleased to announce that Nihongo Benkyo 0.3 has finally been released! Highlights Support for Windows, in addition to Linux. View further details about a result. Kanji dictionary. History and go back/for…

---

## [Index and Query (#54)](https://www.ruby-forum.com/t/index-and-query-54/71342)

<div class="topic-metadata">

**Author:** [@zed.lopez](https://www.ruby-forum.com/u/zed.lopez)\
**Replies:** 0\
**Last updated:** [November 17, 2005, 7:06pm UTC](https://www.ruby-forum.com/t/index-and-query-54/71342 "2005-11-17T19:06:51Z")

</div>

I’m a little late to the party. I just finished PickAxe2 and this is my first quiz (or Ruby program.) Mine doesn’t Marshal the data, but does offer both has\_any and has\_all methods. class Lexicon @@word\_index = {} …

---

## [Ruby-gnome2: emit key press](https://www.ruby-forum.com/t/ruby-gnome2-emit-key-press/48204)

<div class="topic-metadata">

**Author:** [@ces.fci.junk](https://www.ruby-forum.com/u/ces.fci.junk)\
**Replies:** 3\
**Last updated:** [November 17, 2005, 6:42pm UTC](https://www.ruby-forum.com/t/ruby-gnome2-emit-key-press/48204 "2005-11-17T18:42:41Z")

</div>

I’m trying to have a listbox page up/down based on keys pressed. so I thought this could maybe done by using something similar to this: event = Gdk::EventKey.new( Gdk::Event::KEY\_PRESS ) event.set\_keyval(65366) # pag…

---

## [7-zip or rar lib?](https://www.ruby-forum.com/t/7-zip-or-rar-lib/48190)

<div class="topic-metadata">

**Author:** [@Tim.Ferrell](https://www.ruby-forum.com/u/Tim.Ferrell)\
**Replies:** 4\
**Last updated:** [November 17, 2005, 6:09pm UTC](https://www.ruby-forum.com/t/7-zip-or-rar-lib/48190 "2005-11-17T18:09:24Z")

</div>

Does anyone know of libs for manipulating 7-zip or rar archives in ruby? I know there are C libs available but don’t really know where to start on wrapping them with ruby… Thanks, Tim

---

## [Object#to\_b](https://www.ruby-forum.com/t/object-to-b/67427)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 6\
**Last updated:** [November 17, 2005, 6:09pm UTC](https://www.ruby-forum.com/t/object-to-b/67427 "2005-11-17T18:09:24Z")

</div>

Currently, as far as I know, if' andunless’ merely check if an object is of either types NilClass or FalseClass. This seems to contradict the duck-typing paradigm. I propose that we implement a method Object#to\_b that…

---

## [Ruby style question from a newby: exceptions](https://www.ruby-forum.com/t/ruby-style-question-from-a-newby-exceptions/48149)

<div class="topic-metadata">

**Author:** [@richard.j.cole](https://www.ruby-forum.com/u/richard.j.cole)\
**Replies:** 2\
**Last updated:** [November 17, 2005, 5:33pm UTC](https://www.ruby-forum.com/t/ruby-style-question-from-a-newby-exceptions/48149 "2005-11-17T17:33:13Z")

</div>

Hi, Any hints on the best way to catch exceptions from the point of view of good style for the following? puts “Create connection…” imap = IMAP.new(‘sslmail.somewhere.com’, 993, true) puts “Capabilities: cap = #{im…

---

## [Trouble installing Ruby DBI for MySQL](https://www.ruby-forum.com/t/trouble-installing-ruby-dbi-for-mysql/48086)

<div class="topic-metadata">

**Author:** [@captvanhalen](https://www.ruby-forum.com/u/captvanhalen)\
**Replies:** 4\
**Last updated:** [November 17, 2005, 5:18pm UTC](https://www.ruby-forum.com/t/trouble-installing-ruby-dbi-for-mysql/48086 "2005-11-17T17:18:09Z")

</div>

Hello all, first time poster. I installed ruby 1.8.2 without a hitch and am trying to install drivers for accessing MySQL I tried to install mysql-ruby-2.6 with the following: ruby extconf.rb --with-mysql-include=/u…

---

## [Extracting lines from an address](https://www.ruby-forum.com/t/extracting-lines-from-an-address/100099)

<div class="topic-metadata">

**Author:** [@krisleech](https://www.ruby-forum.com/u/krisleech)\
**Replies:** 8\
**Last updated:** [November 17, 2005, 4:56pm UTC](https://www.ruby-forum.com/t/extracting-lines-from-an-address/100099 "2005-11-17T16:56:09Z")

</div>

I have an address stored in mysql as a text field. I’m using ActiveRecord to access the field. But how do I get each line of the address in to their own strings? eg. Address = “12, HouseName Street City Country” –…

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

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