hi, in my book it says that i can output things with "puts" but where will the output appear - i cant find it anywhere? thanks for any tip andreas -- 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 -~----------~----~----~----~------~----~------~--~---
Andreas, puts is for console output. It won''t print anything to a page in Rails. You use it in ruby scripts executed from the console. In Rails, all rendering is done in the .rhtml files, so anything that needs to be output-ted has to be in there. Jason Andreas Schneider wrote:> hi, > > in my book it says that i can output things with "puts" > but where will the output appear - i cant find it anywhere? > > thanks for any tip > andreas > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
puts will output smthg in your console if you have webrick server i now use mongrel and it doesnt show smthg anymore On 11/4/06, Jason Norris <jasonmnorris-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Andreas, > > puts is for console output. It won''t print anything to a page in Rails. > You use it in ruby scripts executed from the console. > In Rails, all rendering is done in the .rhtml files, so anything that > needs to be output-ted has to be in there. > > Jason > > Andreas Schneider wrote: > > hi, > > > > in my book it says that i can output things with "puts" > > but where will the output appear - i cant find it anywhere? > > > > thanks for any tip > > andreas > > > > > > > > >-- Heri R. http://sprinj.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 -~----------~----~----~----~------~----~------~--~---
Andreas Schneider wrote:> > hi, > > in my book it says that i can output things with "puts" > but where will the output appear - i cant find it anywhere? > > thanks for any tip > andreasIt depends how your are running your rails application. If you are using script/server, the puts will output in the server output (in the console) when you access a page. Some setups will crash if they see a "puts" in your code. It sounds like you are trying to do some debugging with these print statements ... I suggest using breakpointer ... simply put a call to "breakpoint" in your code where you want to break, and start script/breakpointer in a new shell ... this will give you an irb console to your rails application at the breakpoint. -- 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 -~----------~----~----~----~------~----~------~--~---
James Schementi wrote:> Andreas Schneider wrote: >> >> hi, >> >> in my book it says that i can output things with "puts" >> but where will the output appear - i cant find it anywhere? >> >> thanks for any tip >> andreas > > It depends how your are running your rails application. If you are using > script/server, the puts will output in the server output (in the > console) when you access a page. Some setups will crash if they see a > "puts" in your code. > > It sounds like you are trying to do some debugging with these print > statements ... I suggest using breakpointer ... simply put a call to > "breakpoint" in your code where you want to break, and start > script/breakpointer in a new shell ... this will give you an irb console > to your rails application at the breakpoint.mhhh seams not that easy... $ ruby script/breakpointer /usr/local/lib/ruby/1.8/drb/drb.rb:837:in `getaddrinfo'': getaddrinfo: No address associated with nodename (SocketError) from /usr/local/lib/ruby/1.8/drb/drb.rb:837:in `open_server_inaddr_any'' from /usr/local/lib/ruby/1.8/drb/drb.rb:860:in `open_server'' from /usr/local/lib/ruby/1.8/drb/drb.rb:756:in `open_server'' from /usr/local/lib/ruby/1.8/drb/drb.rb:754:in `open_server'' from /usr/local/lib/ruby/1.8/drb/drb.rb:1336:in `initialize'' from /usr/local/lib/ruby/1.8/drb/drb.rb:1624:in `start_service'' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/breakpoint_client.rb:146 from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/breakpoint_client.rb:145 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/breakpointer.rb:1 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'' from script/breakpointer:3 -- 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 -~----------~----~----~----~------~----~------~--~---
Andreas Schneider wrote:> > hi, > > in my book it says that i can output things with "puts" > but where will the output appear - i cant find it anywhere?My best advice is don''t use puts in Rails code. It leads to application errors, at least in Apache/FCGI. Use logger.info "whatever you want". It will show up in your development.log or production.log, depending on you RAILS_ENV. --Al Evans-- -- 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 -~----------~----~----~----~------~----~------~--~---