Sponsored Content
Full Discussion: What is Ruby?
Top Forums Shell Programming and Scripting What is Ruby? Post 302455375 by drl on Tuesday 21st of September 2010 11:42:38 AM
Old 09-21-2010
Hi.

I'm glad that methyl brought this up.

I've been leisurely following ruby for a few years. I have one production code, glark, written in ruby. It is a grep-like utility, with lots of bells and whistles -- very slow, but very convenient in some situations. You might find it in one of your repositories, or at:
incava.org

However, whenever I have tried to execute kurumi's one-liners, say:
Code:
ruby -ne 'BEGIN{s = 0};s+=$_.to_f;END{print "Total: #{s}\n"}' file

I get:
Code:
-e:1: undefined method `+' for nil:NilClass (NoMethodError)

This is from:
Code:
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

but I also got it on new install of ruby-full on:
Code:
OS, ker|rel, machine: Linux, 2.6.32-24-generic, i686
Distribution        : Ubuntu 10.04.1 LTS (lucid) 
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]

Something simple, perhaps, that I am over-looking? ... cheers, drl
 

6 More Discussions You Might Find Interesting

1. SuSE

how to ri-rdoc for Ruby on suse

Hello guys, This is suse SLES 9.2. I want to get ri working for all users on this system. I used gem rdoc --all --ri to generate documentation and it went on doing it successfully. Then I tried ri Array It shows following message : Nothing known about Array Therefore I ran... (0 Replies)
Discussion started by: upengan78
0 Replies

2. Shell Programming and Scripting

Parsing the Ruby File

Hai any one pls guide me... We can extract the line number of the sub routine/function/method in a Ruby file using the ctags command. But I want to know the line number in which the sub routine is ending. Example: Say the function get_days_in_hash starts in the line number 20. It... (2 Replies)
Discussion started by: thillai_selvan
2 Replies

3. Programming

Ubuntu ruby on rails

Hi, I am a php developer and I decided to learn ruby on rails. I have a few question. I have an ubuntu virtual machine with lamp. It mean that it has alrweady php and when I access the ip of the machine from my browser it does load the index.php. if I install ruby on rails will theere... (0 Replies)
Discussion started by: programAngel
0 Replies

4. UNIX for Advanced & Expert Users

Need help installing Puppet and Ruby..

Hi, I am working on RHEL 5.6 server, this is in private DMZ. No access to internet. I have downloaded the files I need to install the Puppet & Ruby. My goal is to install Puppet. I have downloaded.... mcollective-2.2.3-1.el5.noarch- SERVER.rpm ... (2 Replies)
Discussion started by: samnyc
2 Replies

5. Shell Programming and Scripting

Printf with backreference in ruby

Hello everybody, May you help with this, I don't know what is wrong. I want trying to print the first 4 characters as decimal and remove the "k's" from the next 7 characters. I'm trying with gsub and backrefence as shown below trying to remove the "k's" and then trying to assign to "x" the... (0 Replies)
Discussion started by: Ophiuchus
0 Replies

6. What is on Your Mind?

Ruby language

Hi All, Could you please suggest books for learning ruby and python language ? Thanks, Pravin (1 Reply)
Discussion started by: pravin27
1 Replies
RAKE(1) 						 Ruby Programmers Reference Guide						   RAKE(1)

NAME
rake -- Ruby Make SYNOPSIS
rake [--f Rakefile] [--version] [-CGNPgnqstv] [-D [PATTERN]] [-E CODE] [-I LIBDIR] [-R RAKELIBDIR] [-T [PATTERN]] [-e CODE] [-p CODE] [-r MODULE] [--rules] [variable=value] target ... DESCRIPTION
Rake is a simple ruby(1) build program with capabilities similar to the regular make(1) command. Rake has the following features: o Rakefiles (Rake's version of Makefiles) are completely defined in standard Ruby syntax. No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?). o Users can specify tasks with prerequisites. o Rake supports rule patterns to synthesize implicit tasks. o Flexible FileLists that act like arrays but know about manipulating file names and paths. o A library of prepackaged tasks to make building rakefiles easier. OPTIONS
--version Display the program version. -C --classic-namespace Put Task and FileTask in the top level namespace -D [PATTERN] --describe [PATTERN] Describe the tasks (matching optional PATTERN), then exit. -E CODE --execute-continue CODE Execute some Ruby code, then continue with normal task processing. -G --no-system --nosystem Use standard project Rakefile search paths, ignore system wide rakefiles. -I LIBDIR --libdir LIBDIR Include LIBDIR in the search path for required modules. -N --no-search --nosearch Do not search parent directories for the Rakefile. -P --prereqs Display the tasks and dependencies, then exit. -R RAKELIBDIR --rakelib RAKELIBDIR --rakelibdir RAKELIBDIR Auto-import any .rake files in RAKELIBDIR. (default is rakelib ) -T [PATTERN] --tasks [PATTERN] Display the tasks (matching optional PATTERN) with descriptions, then exit. -e CODE --execute CODE Execute some Ruby code and exit. -f FILE --rakefile FILE Use FILE as the rakefile. -h --help Prints a summary of options. -g --system Using system wide (global) rakefiles (usually ~/.rake/*.rake ). -n --dry-run Do a dry run without executing actions. -p CODE --execute-print CODE Execute some Ruby code, print the result, then exit. -q --quiet Do not log messages to standard output. -r MODULE --require MODULE Require MODULE before executing rakefile. -s --silent Like --quiet, but also suppresses the 'in directory' announcement. -t --trace Turn on invoke/execute tracing, enable full backtrace. -v --verbose Log message to standard output (default). --rules Trace the rules resolution. SEE ALSO
ruby(1) make(1) http://rake.rubyforge.org/ REPORTING BUGS
Bugs, features requests and other issues can be logged at <http://onestepback.org/redmine/projects/show/rake>. You will need an account to before you can post issues. Register at <http://onestepback.org/redmine/account/register>. Or you can send an email to the author. AUTHOR
Rake is written by Jim Weirich <jim@weirichhouse.org> UNIX
November 7, 2012 UNIX
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy