Displaying 20 results from an estimated 100 matches similar to: "What''s wrong with this code?"
2007 Sep 07
6
ActiveRecord::Base#update_all expected behaviour
Hi
I noticed that if in my code I use the following:
Photo.update_all("title = ''Ruby rocks'' ", "id IN (#{@photo_ids})")
All my objects are properly updated but none of the filters/callbacks
are triggered. Is that what''s expected?
I have a before_update filter set on the Photo class and it gets
totally ignored, I guess the only way to solve this
2012 Mar 22
0
problems configuring cluster to lucci and virtual machines resource
I have Centos 6.1 and i'm configuring cluster with conga, lucci and ricci
these services are installed and running without problem. I need this type
configuration for a high availability of virtual machines which is run on
kvm. My problem is at the time of configuring "service group", when i click
to add appears the new windows wich say "add service to cluster" and i fill
2007 Jan 01
0
Net::HTTP.get_response with local files "file://..."
Hi,
In my application I fetch a webpage with Net::HTTP.get_response(url).
For creating a unit test I don''t want to be depended on an internet
connection. So I tried to give an url like that:
"file:///c:/mydir/mypage.html" (this url works in webbrower). But it
seems that this is not the right protocol for Net::HTTP. Is there any
possibility to use such
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 Apr 11
2
issues on Net:HTTP
in cotroller:
@url=URI.parse(''http://google.com.sg/webhp'')
@res = Net::HTTP.get_response(@clarifyurl)
in view: <%=@res.body>
this page displayed as
301 Moved
The document has moved here
what''s wrong with my code, I want to get the correct reponse HTML
content from google.
--~--~---------~--~----~------------~-------~--~----~
You received this message
2013 May 07
2
Net::HTTP
I''m looking at the documentation:
http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html
And I notice two uses of Net::HTTP. Both are using GET requests. But
what''s the difference? When to use which?
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri
response = http.request request # Net::HTTPResponse object
end
uri =
2006 Feb 06
1
Check, and display, AIM status on rails page
Thought I''d post this in case it''s of use to anyone. Maybe even a recipe?
It''s just some simple helpers to show AIM status on a webpage.
I searched before coding it, and didn''t find anything similar.
Maybe that''s because it was so simple :)
These methods belong in a helper (such as app/helpers/application_helper.rb)
# begin AIM helper methods
def
2010 Oct 31
1
Rails application Webservices
hi all,
I have a rails application at http://electric-sky-98.heroku.com/products
require ''net/http''
require ''uri''
res = Net::HTTP.get_response(URI.parse(''http://electric-
sky-98.heroku.com/products.xml''))
puts res.body
the above code gave me the xml file below:
<?xml version="1.0"
2013 May 11
1
AMI Originate issue
Hi,
I'm getting an issue while executing AMI Originate.
I'm getting "extension does not exists" on Originate's Response, and on the
other hand Asterisk CLI say "fwrite() returned error: Broken pipe"
Please suggest me what is wrong.
Muhammad Faheem
### my originate code block ...
2005 Dec 20
1
Problems w/ Flickr demo
I''m trying to alongside the Flickr demo, and I''m getting the following
error. I''m not sure why, as my code matches up exactly with what''s in
the video. I''d appreciate any help.
RgBJA
-----
OpenSSL::SSL::SSLError in Flickr#search
SSL_CTX_new:: library has no ciphers
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
2008 Mar 19
1
Database Triggered Events in Rails.
I''m creating a message queue system, (think JMS message queue)
Basically, I''ll be firing off an http request as soon as a row appears
in a database.
Now in past implementations I''ve done the following.
1. Polled the database every 0.10 seconds.
2. If something was there to work, I''d tag it as complete.
3. Create a separate thread. (no further database hits
2007 Jan 31
2
SystemStackError: stack level too deep
I''m testing the http module in console.
BUt I got the following error.
Anyone knows why?
>> Net::HTTP.get_print ''www.google.com'', ''index.html''
SystemStackError: stack level too deep
from C:/InstantRails/ruby/lib/ruby/1.8/net/http.rb:451:in
`newobj''
from C:/InstantRails/ruby/lib/ruby/1.8/net/http.rb:451:in
2006 Jul 07
0
Net::HTTP.get_reponse issues ...
Hi,
I''m struggling a bit trying to interface with the Amazon ECS web service
using Net::HTTP.
The code I''ve got so far is ...
def index
search_artist = ''Pink Floyd''
amazon_params = {''Service'' => ''AWSECommerceService'',
''AWSAccessKeyId'' => ''[Removed for
2006 May 06
0
`connect'': undefined method `verify_mode'' for nil:NilClass
Am using Ruby 1.8.4. I am getting this error:
/usr/lib/ruby/1.8/net/http.rb:565:in `connect'': undefined method
`verify_mode'' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/net/http.rb:555:in `do_start''
from /usr/lib/ruby/1.8/net/http.rb:544:in `start''
from /usr/lib/ruby/1.8/net/http.rb:1031:in `request''
from
2006 May 23
0
FakeWeb test helper for Net::HTTP / open-uri web requests
Hey All,
I''ve posted the first release of FakeWeb, a little library to help
with all your http client testing needs. This helper makes it trivial
to setup an idempodent environment for you to test any web service
requests in your applications.
Available on RubyForge, http://rubyforge.org/projects/fakeweb/
== Overview
* Force Net::HTTP (and any dependent libraries, e.g. open-uri) to
2008 Apr 30
1
Avelsieve 1.9.7 and Dovecot/TLS
Hi,
i'm installing a new mail server for our faculty and want to use
the squirrelmail plugin 'avelsieve' (1.9.7). As documented on the
dovecot wiki there is a problem in the STARTTLS code and i
found a solution (that works for my installation):
i've traced the server output in 'get_response' and instead of
a script list i saw "IMPLEMENTATION". So i took a look
2005 Sep 18
1
Timeout::Error (execution expired)
I have a long running task in my Rails app that I plan to run via cron when
deployed.
The problem is that I''m getting an expiration error when trying to test it
out.
Is there a way to change this timeout?
The trace is included. The system is connecting to Flickr, which takes some
time.
Timeout::Error (execution expired):
/usr/lib/ruby/1.8/timeout.rb:42:in `new''
2010 Apr 05
5
paperclip question
Hi All,
My application is using paperclip and its working fine without any
problems, I am able to generate the thumb images and big images from
actual uploaded images. There are many images already uploaded by the
users. Now I want to create small images from the original uploaded
image. For the newly uploaded images its working fine but how can I do
the same for already uploaded image??
if
2009 Feb 21
1
undefined method user_id
Basically, Im trying to add comments to photos that other users have
uploaded. And Ive encountered an error:
NoMethodError in CommentsController#create
undefined method `user_id='' for #<Comment:0x4768cd0>
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1857:in
`method_missing''
2013 Jan 07
4
JSON::ParserError in controller
Hi All
I''m trying to build an application which requires to scrap information
from a webpage. On trying to perform the action, I get an error while
trying to convert the html data to JSON. Has anyone experienced this
before and if so can you please tell me how to solve this problem ?
Please see below for code snippet and error log.
Thanks in advance
Anush
require