Welcome Guest | Login

rake "getaddrinfo: Name or Service not Known"

Hello,

I'm trying to run a rake task (which I made) to insert some default data.  I am able to run rake migrates just fine, but when I run my custom rake task, I get the following error:

getaddrinfo: Name or service not known

My rake line looks like this:

rake db:default_data

Anyone know what may be causing the problem?

Thanks,

Chris

2008-09-25 11:30 AM

I got the following traces while executing the command 'rake db:default_data'

==
** Invoke db:default_data (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:default_data
rake aborted!
getaddrinfo: Name or service not known
==

It seems that the rake task is not able identify your custom script. Please give a a try after storing the contents of 'db:default_data' inside your 'Rakefile'.  

2008-09-25 02:04 PM

Regards,
Rahul
Rahul,

Thanks for the response, but I'm still a little confused.  I have the db:default_data in /lib/tasks/sys_config.rake.  The Rakefile states that if you put a *.rake file in lib/tasks, it will be automatically included.  Also, if I run

rake -T

the db:default_data shows up in the list.  

I guess I'm a little confused about what you mean by

"stor[e] the contents of 'db:default_data' inside your 'Rakefile'"

Do you mean that I need to copy the contents of my sys_config.rake file into the Rakefile?

Thanks,

Chris


2008-09-25 02:36 PM

Yes, try copying the contents of sys_config.rake into the Rakefile. See what outcome that has. We can go from there.

2008-09-25 05:15 PM

So I did that and get the same results.  I'm guessing that I did it correctly (I'm still n00bing my way through custom rake tasks).

Any other ideas?

Thanks,

Chris

2008-09-25 05:37 PM

Can you provide the full error dump? Would help to see what line is doing this.

2008-09-25 05:49 PM

Here it is:

# rake db:default_data --trace

(in /home/****/****)
** Invoke db:default_data (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:default_data
rake aborted!
getaddrinfo: Name or service not known
/usr/local/lib/ruby/1.8/net/protocol.rb:206:in `initialize'
/usr/local/lib/ruby/1.8/net/protocol.rb:206:in `new'
/usr/local/lib/ruby/1.8/net/protocol.rb:206:in `old_open'
/usr/local/lib/ruby/1.8/timeout.rb:56:in `timeout'
/usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout'
/usr/local/lib/ruby/1.8/net/protocol.rb:206:in `old_open'
/usr/local/lib/ruby/1.8/net/smtp.rb:393:in `do_start'
/usr/local/lib/ruby/1.8/net/smtp.rb:378:in `start'
/usr/local/lib/ruby/1.8/net/smtp.rb:316:in `start'
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:586:in `perform_delivery_smtp'
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:469:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:469:in `deliver!'
/usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:352:in `method_missing'
/home/stpauls/st_pauls/app/models/user_observer.rb:3:in `after_create'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/observer.rb:157:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/observer.rb:157:in `update'
/usr/local/lib/ruby/1.8/observer.rb:185:in `notify_observers'
/usr/local/lib/ruby/1.8/observer.rb:184:in `each'
/usr/local/lib/ruby/1.8/observer.rb:184:in `notify_observers'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:338:in `notify'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:302:in `callback'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:227:in `create_without_timestamps'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/timestamp.rb:29:in `create'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2238:in `create_or_update_without_callbacks'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:213:in `create_or_update'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1972:in `save_without_validation'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/validations.rb:934:in `save_without_transactions'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:120:in `rollback_active_record_state!'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:108:in `save'
/home/stpauls/st_pauls/Rakefile:28:in `insert_admin_user'
/home/stpauls/st_pauls/lib/tasks/sys_config.rake:4
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:621:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:621:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:616:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:616:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:582:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:575:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:568:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2031:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2009:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2048:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2003:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:1982:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:2048:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:1979:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.2/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

2008-09-25 06:13 PM

Have you set your ActionMailer smtp settings? If so, what are you setting them to?

2008-09-25 07:26 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.