# Ruby

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

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

---

## [\[Feature #2968\] $B?tCM$N@5Ii$rJV$9%a%=%C%I(B](https://www.ruby-forum.com/t/feature-2968-b-tcm-n-5ii-rjv-9-a-c-i-b/185188)

<div class="topic-metadata">

**Author:** [@Yui\_NARUSE](https://www.ruby-forum.com/u/Yui_NARUSE)\
**Replies:** 16\
**Last updated:** [September 8, 2010, 3:48pm UTC](https://www.ruby-forum.com/t/feature-2968-b-tcm-n-5ii-rjv-9-a-c-i-b/185188 "2010-09-08T15:48:11Z")

</div>

Feature #2968: e$B?tCM$N@5Ii$rJV$9%a%=%C%Ie(B http://redmine.ruby-lang.org/issues/show/2968 e$B5/I\<\<Te(B: Yui NARUSE e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: core e$B?tCM$N@5Ii$rJV$9%a%=%C%I$,M\_$…

---

## [Ruby-hackernews released!](https://www.ruby-forum.com/t/ruby-hackernews-released/194651)

<div class="topic-metadata">

**Author:** [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Replies:** 0\
**Last updated:** [September 8, 2010, 3:04pm UTC](https://www.ruby-forum.com/t/ruby-hackernews-released/194651 "2010-09-08T15:04:16Z")

</div>

Hello everyone, I’ve wrote a little library that allows to programmatically access the popular aggregator site Hacker News. You can find it here (GitHub - bolthar/ruby-hackernews: An API over hacker news's site ), it’…

---

## [Angle Identifier](https://www.ruby-forum.com/t/angle-identifier/194617)

<div class="topic-metadata">

**Author:** [@humandictionary](https://www.ruby-forum.com/u/humandictionary)\
**Replies:** 2\
**Last updated:** [September 8, 2010, 10:41am UTC](https://www.ruby-forum.com/t/angle-identifier/194617 "2010-09-08T10:41:01Z")

</div>

puts “Enter degree of angle:” measure = gets.chomp.to\_i if measure == “180”.to\_i then puts “That’s a straight angle.” if measure == 181…359.to\_i then puts “That’s an obtuse angle.” if measure == 91…179.to\_i then puts…

---

## [Defining self-reflexive operators in Ruby](https://www.ruby-forum.com/t/defining-self-reflexive-operators-in-ruby/194620)

<div class="topic-metadata">

**Author:** [@harryspier](https://www.ruby-forum.com/u/harryspier)\
**Replies:** 3\
**Last updated:** [September 8, 2010, 6:44am UTC](https://www.ruby-forum.com/t/defining-self-reflexive-operators-in-ruby/194620 "2010-09-08T06:44:54Z")

</div>

In the same way that a += 1 means a = a+1 is it possible in Ruby to create an operator such as .! (or something like that) such that someObject.!someMethod gives the same result as someObject = someObject.someMethod

---

## [Mechanize Form File Upload](https://www.ruby-forum.com/t/mechanize-form-file-upload/194605)

<div class="topic-metadata">

**Author:** [@tkeber](https://www.ruby-forum.com/u/tkeber)\
**Replies:** 1\
**Last updated:** [September 8, 2010, 5:55am UTC](https://www.ruby-forum.com/t/mechanize-form-file-upload/194605 "2010-09-08T05:55:39Z")

</div>

Hi all, I’m trying to upload a file to a Form in this way. My Question is, how to get the imagefile posted correctly. def uploadpicture(username, password, imagepath) agent = Mechanize.new agent.post(“http://www.som…

---

## [Installed gem does not load](https://www.ruby-forum.com/t/installed-gem-does-not-load/194608)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 1\
**Last updated:** [September 8, 2010, 5:47am UTC](https://www.ruby-forum.com/t/installed-gem-does-not-load/194608 "2010-09-08T05:47:38Z")

</div>

I am attempting run, in 1.8.6, an fxruby sample called babelfish.rb babelfish.rb requires a gem called tranexp I installed the gem and gem list --local produces (in part) produces tranexp (1.0.1) I, of course, trie…

---

## [How to require Ruby 1.9 from a required file?](https://www.ruby-forum.com/t/how-to-require-ruby-1-9-from-a-required-file/194545)

<div class="topic-metadata">

**Author:** [@sackerson](https://www.ruby-forum.com/u/sackerson)\
**Replies:** 3\
**Last updated:** [September 8, 2010, 3:56am UTC](https://www.ruby-forum.com/t/how-to-require-ruby-1-9-from-a-required-file/194545 "2010-09-08T03:56:54Z")

</div>

Is there any way to require Ruby 1.9 from a required file such that I can trigger an error message before the main file is parsed? Suppose I’m making a DSL that depends on the very nice Ruby 1.9 hash syntax. Here’s a…

---

## [Sinatra Error - \`read ': Invalid argument .. (Errno::EINVAL)](https://www.ruby-forum.com/t/sinatra-error-read-invalid-argument-errno-einval/194614)

<div class="topic-metadata">

**Author:** [@bhayzone](https://www.ruby-forum.com/u/bhayzone)\
**Replies:** 1\
**Last updated:** [September 8, 2010, 2:55am UTC](https://www.ruby-forum.com/t/sinatra-error-read-invalid-argument-errno-einval/194614 "2010-09-08T02:55:26Z")

</div>

I’m hoping someone can help me here. I am a complete newbie to Ruby and Sinatra and cannot find any information related to this problem anywhere. Any help would be greatly appreciated. Ruby version=1.9.2 I also have …

---

## [How can I solve this issue?](https://www.ruby-forum.com/t/how-can-i-solve-this-issue/194596)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 4\
**Last updated:** [September 7, 2010, 9:56pm UTC](https://www.ruby-forum.com/t/how-can-i-solve-this-issue/194596 "2010-09-07T21:56:44Z")

</div>

I have a script (Attached), which is based on this tutorial: http://dicom.rubyforge.org/tutorial1.html When I run the script, I get the following: C:\\Users\\Abder-Rahman\\Desktop\\Research\\dicom\>ruby dicom\_info.rb C:/Ru…

---

## [Installing ActiveRecord gem](https://www.ruby-forum.com/t/installing-activerecord-gem/194592)

<div class="topic-metadata">

**Author:** [@swengineer](https://www.ruby-forum.com/u/swengineer)\
**Replies:** 4\
**Last updated:** [September 7, 2010, 9:07pm UTC](https://www.ruby-forum.com/t/installing-activerecord-gem/194592 "2010-09-07T21:07:15Z")

</div>

I’m trying to install the ActiveRecord gem, but getting the following: C:\\Users\\Abder-Rahman\\Desktop\\Research\\dicom\>gem install activerecord ERROR: While executing gem … (Gem::RemoteFetcher::FetchError) too many conn…

---

## [Dynamic variables in blocks vs constants](https://www.ruby-forum.com/t/dynamic-variables-in-blocks-vs-constants/194602)

<div class="topic-metadata">

**Author:** [@jdarklin](https://www.ruby-forum.com/u/jdarklin)\
**Replies:** 2\
**Last updated:** [September 7, 2010, 8:39pm UTC](https://www.ruby-forum.com/t/dynamic-variables-in-blocks-vs-constants/194602 "2010-09-07T20:39:48Z")

</div>

Hi, I know that dynamic variables created in block it is not accessible from outside of that block but I noticed that dynamic constants can be accessed and I want to know why it is so. Sorry for my bad english. For be…

---

## [Ruby without framework](https://www.ruby-forum.com/t/ruby-without-framework/194598)

<div class="topic-metadata">

**Author:** [@mrashi12](https://www.ruby-forum.com/u/mrashi12)\
**Replies:** 3\
**Last updated:** [September 7, 2010, 7:46pm UTC](https://www.ruby-forum.com/t/ruby-without-framework/194598 "2010-09-07T19:46:05Z")

</div>

Can I use ruby code running in web browser without any frameworks used? Also anyone please tell me how to make framework, Please give me some tips or spark to start with. I need to make a new framework because I need…

---

## [Writing a domain specific macro processor in ruby](https://www.ruby-forum.com/t/writing-a-domain-specific-macro-processor-in-ruby/194600)

<div class="topic-metadata">

**Author:** [@Handy\_G](https://www.ruby-forum.com/u/Handy_G)\
**Replies:** 3\
**Last updated:** [September 7, 2010, 7:20pm UTC](https://www.ruby-forum.com/t/writing-a-domain-specific-macro-processor-in-ruby/194600 "2010-09-07T19:20:37Z")

</div>

I’m thinking of something like the m4 processor ( of autotools fame or infamy ), but with only a few domain specific built-in macros. Can anyone offer some helpful hints?

---

## [Ruby for desktop and web](https://www.ruby-forum.com/t/ruby-for-desktop-and-web/194468)

<div class="topic-metadata">

**Author:** [@mrashi12](https://www.ruby-forum.com/u/mrashi12)\
**Replies:** 5\
**Last updated:** [September 7, 2010, 6:23pm UTC](https://www.ruby-forum.com/t/ruby-for-desktop-and-web/194468 "2010-09-07T18:23:14Z")

</div>

I need to develop a application which can be used in desktop environment and web environment. The code/core classes written for desktop version must be reused for the web also. code REUSE is a must property. I had t…

---

## [Cross-language debugging for jruby-embed?](https://www.ruby-forum.com/t/cross-language-debugging-for-jruby-embed/194599)

<div class="topic-metadata">

**Author:** [@runby](https://www.ruby-forum.com/u/runby)\
**Replies:** 0\
**Last updated:** [September 7, 2010, 6:07pm UTC](https://www.ruby-forum.com/t/cross-language-debugging-for-jruby-embed/194599 "2010-09-07T18:07:26Z")

</div>

Hi, I know there is an article “Cross-language debugging: from Ruby to Java and back” for a JRuby project in Netbeans. Is there a way to cross debug a Java project with jruby-embed inside (java - jruby - java)? Than…

---

## [Enumerator#each return value is surprising](https://www.ruby-forum.com/t/enumerator-each-return-value-is-surprising/194364)

<div class="topic-metadata">

**Author:** [@christoforever](https://www.ruby-forum.com/u/christoforever)\
**Replies:** 7\
**Last updated:** [September 7, 2010, 5:08pm UTC](https://www.ruby-forum.com/t/enumerator-each-return-value-is-surprising/194364 "2010-09-07T17:08:16Z")

</div>

Generally in Ruby, if enum is an Enumerable, enum.each returns enum – this seems to be the case for all enums. But for Enumerator, it seems to return…well, something else. For enumerators created with enum\_for, it ret…

---

## [IronRuby and Cucumber](https://www.ruby-forum.com/t/ironruby-and-cucumber/194436)

<div class="topic-metadata">

**Author:** [@kavitha](https://www.ruby-forum.com/u/kavitha)\
**Replies:** 3\
**Last updated:** [September 7, 2010, 4:59pm UTC](https://www.ruby-forum.com/t/ironruby-and-cucumber/194436 "2010-09-07T16:59:54Z")

</div>

Hi, While I was trying to integrate Iron Ruby and Cucumber the installation succeeded without any problems. But when I wanted to execute some examples for CS folder I found the folder to be missing. Can anyone pleas…

---

## [Ruby 1.9 and Redis](https://www.ruby-forum.com/t/ruby-1-9-and-redis/194587)

<div class="topic-metadata">

**Author:** [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Replies:** 2\
**Last updated:** [September 7, 2010, 4:34pm UTC](https://www.ruby-forum.com/t/ruby-1-9-and-redis/194587 "2010-09-07T16:34:42Z")

</div>

Hello, I’m running on Snow Leopard, Ruby 1.9.1-p429 and i’m using the Redis 2.0.5 gem. Now when I’m running this line on OS X: redis.keys("") it fails, when I run it on Linux, it works! on OS X, I’m getting the foll…

---

## [Issue with the devise](https://www.ruby-forum.com/t/issue-with-the-devise/194588)

<div class="topic-metadata">

**Author:** [@saurabh\_purnaye](https://www.ruby-forum.com/u/saurabh_purnaye)\
**Replies:** 0\
**Last updated:** [September 7, 2010, 4:11pm UTC](https://www.ruby-forum.com/t/issue-with-the-devise/194588 "2010-09-07T16:11:29Z")

</div>

Hi, I am using Devise and want to override a method from a controller also there is a different way for signup. I am using RAILS = 2.3.5 and DEVISE= 1.0.8 I tried using class Mycontroller \< Devise::RegistrationsCon…

---

## [New to ruby - Need help with simple guessing program](https://www.ruby-forum.com/t/new-to-ruby-need-help-with-simple-guessing-program/194333)

<div class="topic-metadata">

**Author:** [@chichu](https://www.ruby-forum.com/u/chichu)\
**Replies:** 6\
**Last updated:** [September 7, 2010, 3:19pm UTC](https://www.ruby-forum.com/t/new-to-ruby-need-help-with-simple-guessing-program/194333 "2010-09-07T15:19:33Z")

</div>

Ok,so as a little practice I’ve decided to come up with a Guessing Game where the user is able to guess a number, and if it the same as the randomly generated number by the computer, he gets a message that says a litt…

---

## [\[Newbie\] What folder to upload to?](https://www.ruby-forum.com/t/newbie-what-folder-to-upload-to/194585)

<div class="topic-metadata">

**Author:** [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Replies:** 2\
**Last updated:** [September 7, 2010, 3:18pm UTC](https://www.ruby-forum.com/t/newbie-what-folder-to-upload-to/194585 "2010-09-07T15:18:00Z")

</div>

Hi all, I am reading all the tutorials and trying to dive into ruby here. I have a remote web server I want to test my programming on but I am used to just uploading a file (php or .net) and running it in the root fol…

---

## [Gems LoadError in Linux](https://www.ruby-forum.com/t/gems-loaderror-in-linux/180618)

<div class="topic-metadata">

**Author:** [@rorsch](https://www.ruby-forum.com/u/rorsch)\
**Replies:** 8\
**Last updated:** [September 7, 2010, 2:58pm UTC](https://www.ruby-forum.com/t/gems-loaderror-in-linux/180618 "2010-09-07T14:58:47Z")

</div>

Hello, I’m new to Ruby and I wanna run a test a simple Gem in the latest Ubuntu. I’ve downloaded Ruby 1.9.1 and RubyGems, and the Gem I wanna test is NFC - which appears installed as a Local Gem after I did $ sudo ge…

---

## [Setting encoding of pages in Capybara](https://www.ruby-forum.com/t/setting-encoding-of-pages-in-capybara/194575)

<div class="topic-metadata">

**Author:** [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Replies:** 1\
**Last updated:** [September 7, 2010, 1:30pm UTC](https://www.ruby-forum.com/t/setting-encoding-of-pages-in-capybara/194575 "2010-09-07T13:30:27Z")

</div>

Hi all, Quick encoding question: say I’m trying to grab data from a Japanese page using Capybara and Rack::Test, and I get badly encoded text in the response. e.g. running this script: require ‘rubygems’ require ‘…

---

## [Round to two decimal place](https://www.ruby-forum.com/t/round-to-two-decimal-place/194567)

<div class="topic-metadata">

**Author:** [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Replies:** 4\
**Last updated:** [September 7, 2010, 1:28pm UTC](https://www.ruby-forum.com/t/round-to-two-decimal-place/194567 "2010-09-07T13:28:55Z")

</div>

Hi I have a variable say @price. It is either blank or has a value. If it is blank I have to show it like $ 0.00 . So I wrote helper like @price.blank? ? ‘$’+‘0.00’ : '$'removed\_email\_address@domain.invalid\_s Bu…

---

## [Help required in running icucumber for CS examples](https://www.ruby-forum.com/t/help-required-in-running-icucumber-for-cs-examples/194581)

<div class="topic-metadata">

**Author:** [@kavitha](https://www.ruby-forum.com/u/kavitha)\
**Replies:** 0\
**Last updated:** [September 7, 2010, 1:14pm UTC](https://www.ruby-forum.com/t/help-required-in-running-icucumber-for-cs-examples/194581 "2010-09-07T13:14:57Z")

</div>

Hello All, After installing Iron ruby1.0 and cucumber-0.6.4 everything worked fine till compile.bat was executed. But when I executed icucumber features for cs examples I am getting the below error. I googled severa…

---

## [How to embed picture into e-mail with mail gem (any lib)](https://www.ruby-forum.com/t/how-to-embed-picture-into-e-mail-with-mail-gem-any-lib/194579)

<div class="topic-metadata">

**Author:** [@ther](https://www.ruby-forum.com/u/ther)\
**Replies:** 0\
**Last updated:** [September 7, 2010, 1:03pm UTC](https://www.ruby-forum.com/t/how-to-embed-picture-into-e-mail-with-mail-gem-any-lib/194579 "2010-09-07T13:03:20Z")

</div>

And the picture will show (not as attachment) on gmail or outlook client. This is what I am doing(according to what I have found on net), but all I get is a square which tells where picture should be shown but it isn’…

---

## [Using Nokogiri to scrape multiple websites](https://www.ruby-forum.com/t/using-nokogiri-to-scrape-multiple-websites/194415)

<div class="topic-metadata">

**Author:** [@rmac217](https://www.ruby-forum.com/u/rmac217)\
**Replies:** 5\
**Last updated:** [September 7, 2010, 11:55am UTC](https://www.ruby-forum.com/t/using-nokogiri-to-scrape-multiple-websites/194415 "2010-09-07T11:55:36Z")

</div>

Hi everyone, I’m looking to use Nokogiri to scrape about 10 websites for their anchor texts and output them on screen. What would be the best way to achieve this? I have tried doing something like this without much l…

---

## [Trouble with mkfifo and forks](https://www.ruby-forum.com/t/trouble-with-mkfifo-and-forks/194542)

<div class="topic-metadata">

**Author:** [@joshs](https://www.ruby-forum.com/u/joshs)\
**Replies:** 2\
**Last updated:** [September 7, 2010, 10:40am UTC](https://www.ruby-forum.com/t/trouble-with-mkfifo-and-forks/194542 "2010-09-07T10:40:19Z")

</div>

In a nutshell: Create a pipe Fork twice Each for sends 10 strings over the pipe See what comes out the other side So, why isn’t what I send coming out? class WaitListTest \< Test::Unit::TestCase NUMBER\_OF\_ORDERS = 2 …

---

## [How to send multiple parameters in the req.set\_form\_data](https://www.ruby-forum.com/t/how-to-send-multiple-parameters-in-the-req-set-form-data/194562)

<div class="topic-metadata">

**Author:** [@arunachandu](https://www.ruby-forum.com/u/arunachandu)\
**Replies:** 2\
**Last updated:** [September 7, 2010, 10:38am UTC](https://www.ruby-forum.com/t/how-to-send-multiple-parameters-in-the-req-set-form-data/194562 "2010-09-07T10:38:54Z")

</div>

Hi , I am writing ruby code for calling APIs … i am writing the POST request form . require ‘net/http’ require ‘uri’ url = URI.parse(‘http://localhost:3000/api/blogs/create.xml’) req = Net::HTTP::Post.new(url.path) …

---

## [Dice Roller](https://www.ruby-forum.com/t/dice-roller/194552)

<div class="topic-metadata">

**Author:** [@humandictionary](https://www.ruby-forum.com/u/humandictionary)\
**Replies:** 8\
**Last updated:** [September 7, 2010, 9:52am UTC](https://www.ruby-forum.com/t/dice-roller/194552 "2010-09-07T09:52:43Z")

</div>

It won’t work. It’s odd. It won’t stop and it won’t add a number onto x so it would say “Roll 1: 5 Roll 2: 3” etc It just repeats “Roll 1: (random number)”. Also, is there a way for me to add one to the rand functi…

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

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