similar to: how do i print to command prompt from the controller or

Displaying 20 results from an estimated 80000 matches similar to: "how do i print to command prompt from the controller or"

2008 Jan 30
2
How do I get logging with rspec?
Say I''m testing a controller with rspec, and I have logger.debug and logger.error calls. Normally I''d like them to write to the appropriate file, but in this case I''d like to see the output on STDOUT. Is there an easy way to redirect logging in rspec to do this? I''m thinking that controller.should_receive(:logger).and_return(logger) should start it off,
2008 Mar 24
4
Doesnt show log on command prompt
I have latest version of mongrel installed. But when I run ''ruby script/server'' it starts the server and shows nothing else, like development log it used to show on my previous dev machine. Any idea? -- Posted via http://www.ruby-forum.com/.
2006 Dec 14
8
ActiveRecord outside of rails
I have a few questions regarding using activerecord outside of rails. Usage is with legacy databases, which gives rise to some of the problems. Probably the first, and most simple question though, is how to capture the SQL log, with which I can hopefully figure the other stuff out. I''m currently trying ActiveRecord::Base.logger = Logger.new STDOUT Based on random googles, but it
2009 Jul 20
1
Application logging in R
Hello, I'm curious to know how people log their applications in R. It seems like it's a combination of cat statements or writing out the session to a file, given the discussions I've had with people. This is fine for interactive work but is a little lacking for automated systems. To address this, I've written a logging facility modeled on the log4j Java library. The basic concept
2010 Apr 15
1
Using Rails.Logger in a gem in Rails 3beta3
Hi fellows! I want to use the Rails.logger in my gem. I try the following code in my main gem-file. require ''rails/logger'' puts "init1" ::Rails.logger.info("hi") puts "init2" The funny thing is: It even don''t give me the output of puts in the stdout of the server! But if I remove the call to Rails.logger the puts are displayed in the
2011 Jul 01
5
Timestamp in unicorn logs
I would love to see a timestamp in each line of unicorn stderr and stdout logs. Has this been considered? Thanks. Best, alex sharp
2006 May 03
6
ActiveRecord and Lost Connection
This isnt totally a rails question; I am using ActiveRecord for storing some simple values into a database. My problem; I keep gettign MySQL Errors. On the Win32 machine it was off and on. Now on the linux machine (ubuntu) I can'' t connect at all. I have all the password settings correct. My only thought, I am working with Threads and thought that might cause the issue, but I
2008 Jul 08
6
Show SQL request without issuing it
Hi all, I saw that some object.save is causing the SQL request to crash, but I don''t see the SQL request in the logs (only ruby code that''s showing an error during the .save method). Is there any way to show the SQL request before it''s issued to the database ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received
2005 Feb 12
3
ActiveRecord not updating record
Hi, I''m having some problems using ActiveRecord to update records in a sqlite database. This isn''t exactly as rails question, since I''m doing this initial import outside of rails, but I''m hoping someone hear might have an idea as to what my problem is. The basic problem is with the following code (which is run in a big loop) m = Movie.find_by_title_and_year
2006 Aug 09
1
strange - params.nil? true in controller
Hi All I am trying to implement a functionality where a user clicks on "Back to Search Results" link he is taken to the search result screen. For this I am storing his search criteria (params object) in session. Here is my code ______________________________________________________________________________________________________________ *def* search
2006 Aug 08
3
params object nil in controller action
Hi All I am trying to implement a Back to Search Results functionality, by storing the user''s search criteria (params) in session and then reusing those params instead of request params when user clicks on "Back to Search Results link". here is my code ________________________________________________________________________ def search if session[:incidentSearch].nil? or
2013 May 11
1
STDOUT.should_receive(:puts).with Works *** (:print) fails
I use: STDOUT.should_receive(:puts).with...... many times in RSPEC However, I have a couple of "do you want(Y/N)?" where I use ''print'' and apparently ..(:print).with... does not work. I can change ''print'' to ''puts'' and it works perfectly. How do I test :print and ...getch("y") for input??? Any help would be
2006 Jun 07
9
lighttpd/fastcgi - where does stdout go?
i''m using lighty and fastcgi in my rails production environment. standard output appears to get swallowed up somewhere... it''s clearly not coming out of the development log. don''t know where to look for it. is this a byproduct of running in production mode? is there a way to turn this off? thanks, paul
2006 Aug 21
3
strange problem with system call
Hi, I am using backgroundrb to create a automated system of typo blogs.So, users can create new typo applications using web interface and all that jazz. Now..its working perfectly except one minor glitch. Since latest version of typo has a command called "typo", i simply use that command to install new typo app.And it works. def do_work(args) DIR =
2007 Oct 02
3
[PATCH] SIGTERM and SIGINT handler to flush xentop -b outputs
# HG changeset patch # User inakoshi.hiroya@jp.fujitsu.com # Date 1191287395 -28800 # Node ID 5543e74774a826b1781893982ed5052312b820fc # Parent 83239b2890723e0c06bad507bb273a970784b18e Flush stdout when xentop -b gets SIGINT and SIGTERM. It is useful when you stop xentop -b by keyboard interrupt or by other programs such as killall from a batch script. You would have missed the bottom part of
2009 May 19
1
logging with the daemons gem
I am trying to leverage the daemons gem but I am confused about the proper way to set up logging. I am able pass options which configure stdout to go to a log file but it seems like all calls to Rails.logger are disabled as I see the following message in my output: usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/buffered_logger.rb:99:in `write'': closed
2006 Nov 06
4
Errno::EBADF (Bad file descriptor)
I posted this to the discussion forum on rubyforge.org, but it appears that it would have been better to post here. Does anyone have any advice on how to resolve the problem reported at http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145? Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL:
2007 Apr 26
8
Win32 service - Errno::EINVAL (Invalid argument) when uploading image file
Hi guys, I''m facing an error trying to run my app as mongrel_service, hope those who have faced similar issue can help to shed some lights. The app was fine when running from console, but when running it as a service, it failed when I try to upload ''image file'', it has no issue uploading other types of files. Environment: ------------ mongrel (1.0.1, 0.3.13.3)
2007 Jan 21
1
logging to stdout
Hey, I''m using mongrel supervised via runit. I''d like to capture mongrel logs with svlogd, which just requires logging to stdout/stderr. But, the Rails app is logging in its own log directory. Is there a way to make both mongrel and Rails log to stdout/stderr? Thanks, Mike -- Michael P. Soulier <msoulier at digitaltorque.ca> "Any intelligent fool can make things
2006 Aug 03
3
how do i build this? is the only way to use session, or can
i pass and save muliple paramters between different views with different models? what i am trying to do use instead of the user filling out forms to search my database, i just want them to click on links. the first link selects data from one table and then a different view of links will be displayed. the user will then click on a new link but i will need to also know what the user clicked