I have downloaded and installed Rails 1.2. When I go to the command line and go into ./script/console, I am getting something peculiar happening. Once I am in the console, everytime I type a command and hit return to see the results, I get a "=> nil" after every line. Can anyone explain this? See example below: powerbook17:~/Sites/rails/depot fernando$ ./script/console Loading development environment.>> string = "Now is the time"=> "Now is the time">> puts string.at(2)w => nil>> puts string.from(8)he time => nil>> puts string.firstN => nil>> puts string.starts_with?("No")true => nil>> count = Hash.new(0)=> {}>> string.each_char {|ch| count[ch] += 1}=> nil>> puts count.inspect{" "=>3, "w"=>1, "m"=>1, "N"=>1, "o"=>1, "e"=>2, "h"=>1, "s"=>1, "t"=>2, "i"=>2} => nil>> puts "cat".pluralizecats => nil>>-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Doesn''t console return whatever the previous statement equates to? And doesn''t puts return a nil? Seems to make sense. I don''t normally try instead of puts string.at(2) try string.at(2) you get the answer ether way. Fernando Aleman wrote:> I have downloaded and installed Rails 1.2. When I go to the command line > and go into ./script/console, I am getting something peculiar happening. > Once I am in the console, everytime I type a command and hit return to > see the results, I get a "=> nil" after every line. Can anyone explain > this? See example below: > > powerbook17:~/Sites/rails/depot fernando$ ./script/console > Loading development environment. >>> string = "Now is the time" > => "Now is the time" >>> puts string.at(2) > w > => nil >>> puts string.from(8) > he time > => nil >>> puts string.first > N > => nil >>> puts string.starts_with?("No") > true > => nil >>> count = Hash.new(0) > => {} >>> string.each_char {|ch| count[ch] += 1} > => nil >>> puts count.inspect > {" "=>3, "w"=>1, "m"=>1, "N"=>1, "o"=>1, "e"=>2, "h"=>1, "s"=>1, "t"=>2, > "i"=>2} > => nil >>> puts "cat".pluralize > cats > => nil >>>-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David, Thank you for your response. You are correct. I tried the console again without the "puts" and got the answer without the => nil. I appreciate your assistance. David Harkness wrote:> Doesn''t console return whatever the previous statement equates to? > And doesn''t puts return a nil? > > Seems to make sense. > > I don''t normally try > instead of puts string.at(2) > try string.at(2) > you get the answer ether way.-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---