similar to: Trapping specific errors

Displaying 20 results from an estimated 1000 matches similar to: "Trapping specific errors"

2006 Mar 13
8
Nested find(:all, :include => ) statements
Is there a way for me to do: OrderItem.find(:all, :include => [:user, :product => [:supplier]] So I don''t have a supplier_id on my order_item, but have it on my product, which is part of order_item. Joerg -- Posted via http://www.ruby-forum.com/.
2008 Jun 12
1
how do I mock the Rails Logger with should_receive?
Hey Guys, I''m trying to mock the Rails Logger for the following code: ... rescue TimeoutError => error $logger.error("#{self.name} Timeout for #{path}: #{error}") and return rescue SocketError => error $logger.error("#{self.name} SocketError for #{path}: #{error}") and return rescue StandardError => error
2008 Jun 12
1
Does anyone know how to mock the Rails Logger then set expectations with should_receive?
Hey Guys, I''m trying to mock the Rails Logger for the following code: ... rescue TimeoutError => error $logger.error("#{self.name} Timeout for #{path}: #{error}") and return rescue SocketError => error $logger.error("#{self.name} SocketError for #{path}: #{error}") and return rescue StandardError => error
2006 Feb 03
3
Breakpointer not working
When I try to run script/breakpointer, I get the following error: /usr/local/lib/ruby/1.8/drb/drb.rb:837:in `getaddrinfo'': getnameinfo: Non-recoverable failure in name resolution (SocketError) It''s Rails 1.0 on OSX 10.4.4. Any suggestions?
2006 Jul 17
14
REST Relationship Models
I''m trying to figure out an elegant way to do this: I have the following three tables: people, employer, employees And consequently the following three models: class Person < ActiveRecord::Base end class Employer < ActiveRecord::Base has_many :employees end class Employee < ActiveRecord::Base belongs_to :person belongs_to :employer end I want to be able to say:
2006 May 31
7
How to render from with <%%> ?
I have a loop that I iterate through in my view. <% coll.each do |itm| puts(itm.value) end %> How do I render the itm.value without using a <%= %> tag? Should puts not work? Joerg P.S. There is a good enough reason for me wanting to do this :-) -- Posted via http://www.ruby-forum.com/.
2006 Feb 14
7
Launching a standalone Rails app
Hi, I''ve developed a standalone Rails app - using tar2rubyscript and rubyscript2exe. The users aren''t going to understand that the''ll need to open the browser and go to 127.0.0.1:3000 to view the app, after running the exe. I am wondering whether other people have tackled this problem in the past, and how they went about solving it. One way would be to write a
2006 Jan 22
3
Download an Image using Net::HTTP
Hi, I need to download an image, and I''ve mucked about with Net::HTTP resp = Net::HTTP.get_response(''www.mydomain.com'', ''/test.jpg'') f = File.new("test.jpg","w") f.write(response.body) And various other combinations using HTTP.get etc. Anyway, I get an image, but it looks very psychedelic. This is obviously not the correct way.
2008 Feb 12
4
getaddrinfo: Name or service not known
Hi. When running "puppetd --server <puppetmaster> --waitforcert 50 --test" on a puppet client we get the following error: /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'': getaddrinfo: Name or service not known (SocketError) from /usr/lib/ruby/1.8/net/http.rb:560:in `open'' from /usr/lib/ruby/1.8/net/http.rb:560:in `connect''
2006 Jan 12
8
Synching between Sqlite and MySql
Hi folks, I am running an offline Rails app that periodically connects to the Internet to download the latest catalogue, and upload any new orders. I am about to implement the synching bit - and was thinking whether there is any other solution other than writing webservices and code to do a manual sync of the data, or whether there is a more nifty and robust way using say replication?
2006 Feb 17
2
HELP: Strange problem with breakpointer - stopped working
Hello, I am in the middle of my first ROR project and suddently the breakpointer script (./script/breakpointer) does allways return the error listed below. All time before it was working without problems - but the funny think, I did not change anything on the system (despite downloading the Suse Security Patches). I am running: Suse 9.3 Rails 1.00 Ruby 1.8.3 Please help, if you have any
2006 Aug 16
1
ActionMailer cannot use SMTP for email delivery...
RoR aficionados, I''ve configured ActionMailer for SMTP delivery of emails, and have configured "config/environment.rb" accordingly, including the address of our (external, but fully operational - checked and double-checked :-) SMTP server. Sending out emails from my Windows development laptop works without a hitch, but on a Linux staging server using the exact same source
2008 May 30
3
Mongrel error since updating to OSX 10.5.3
Howdy, I''m getting an error message when trying to run one of my rails apps, which seems to have started after updating to 10.5.3. mattdaw-2:v1.5_patch mdaw$ mongrel_rails start ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... /usr/local/ruby-patched/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../ lib/mongrel/tcphack.rb:12:in
2006 Aug 16
5
installing Ruby on Rails behind a firewall
Ok, I went to the "Get Ruby on Rails ..." web page and followed directions. When I get to the step where I''m to do this: gem install rails --include-dependencies I get this error: ERROR: While executing gem ... (SocketError) getaddrinfo: no address associated with hostname. Here is my configuration, Win XP Pro Running commands in a cygwin "bash" sh. And I
2006 Sep 06
3
DRb error when using rails_spec on OS X
Hi, all- I started playing with RSpec in a new Rails app. I''ve installed the plugin and bootstrapped it, and run ''script/rails_spec_runner'' (not rails_spec_server as the website currently reads, btw) in a separate shell, then in another shell I run ''script/rails_spec'' and get the following: /usr/local/lib/ruby/1.8/drb/drb.rb:837:in
2006 Feb 22
8
Install Rails
My computer doesn''t have network . So when I installed Rails , I had the following error : C:\ruby\bin>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install rails --include-dep endencies Attempting local installation of ''rails'' Local gem file not found: rails*.gem Attempting remote installation of ''rails'' ERROR: While executing
2009 Nov 11
1
getaddrinfo: nodename nor servname provided, or not known
Hi there, If I want to create email within my application (in production), how is this best achieved?? Following the railsspace tutorial, it only really suggests to use :smtp. I''d read on another site that to generate emails locally, i need to use :sendmail instead... However - I havent seen any decent examples of how to get this configured to be able to send emails within my local
2006 Feb 09
2
breakpointer error
Hi, I can''t get breakpointer to work on locomotive. Pretty sure it used to work... Any ideas?? Jeroen jeroen$ ruby script/breakpointer /Applications/Locomotive/Bundles/rails-1.0.0-max.bundle/Contents/Resources/ports/lib/ruby/1.8/drb/drb.rb:828:in `getaddrinfo'': getaddrinfo: No address associated with nodename (SocketError) from
2009 Feb 08
2
SocketError in EmailController#correspond
SocketError in EmailController#correspond getaddrinfo: no address associated with hostname. Please see above, these are the errors i get when i try to email a user on my networking site. Can you help please. Actionmailer address = smtp.vodafone.ie Below is code used for the email controller in apps/controllers/email_controller.rb There doesnt seem to be any code missing. Can someone help with
2006 Sep 28
1
upload_progress and DRb.start_service crashes
Whenever I tried to start mongrel_rails with the upload progress script, it would die with the following error: /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