Robert,

1) The same deprecation warnings probably happen when you just run "rails c" or 
"rails s", right? If so, those are just general deprecation warnings that are 
happening when you boot up the app. Today, you can ignore them (hence, 
warning). In the long run, you'll want to fix those as you upgrade gems and 
refactor code.

2) Custom rake tasks (defined in your app) should have a description above 
them. You actually put the description on its own line above the line that 
starts with the word "task" (slightly confusing). See the section "Describing 
Your Tasks" here http://jasonseifer.com/2010/04/06/rake-tutorial

You'll notice that desc comes on its own line before the task line. If you fail 
to put that description in, your Rake task will still run, but it won't show up 
in the rake -T output. 

Finally, you probably almost certainly don't want to be running 
RAILS_ENV="production" if you are developing locally on your own machine. And 
learn to use a debugger-- I recommend byebug if you're using Ruby 2.0 or above, 
and put "byebug" at the top of your rake task. Then just run your rask task and 
verify that you fall into the debugger. (I'm telling you this as a sanity check 
methodology because you are trying to verify that you know how to run the task)

Hope that helps.
-Jason


On Nov 18, 2014, at 1:31 PM, Robert Fitzpatrick <rob...@webtent.org> wrote:

> I am new to ruby and maintaining an existing web application. I need to 
> change the FTP server in a task and trying to familiarize myself with rake 
> tasks. The task is in lib/tasks/archives.rake under the namespace utils. I 
> read over a rake tutorial and viewed rake options to try and show information 
> about the task and possibly run it to test. But when I do 'rake -T', I get a 
> lot of DEPRECATED messages and the list afterward does not have my task 
> listed. This is how the task is defined:
> 
> namespace:utils do
>  <snip>
>  task :process_archives => :environment do
>  <snip>
> 
> But I have no task listed with that name? I tried 'rake -D 
> utils:process_archives' as well and only got the deprecated messages output. 
> I do see the task in the schedule.rb file...
> 
> ./config/schedule.rb:  command %{#{cmd_root} && cd 
> /var/www/vhosts/xxxx/current && bundle exec rake utils:process_archives 
> DIR="/var/www/vhosts/xxxx/shared/tmp" RAILS_ENV=production}
> 
> And the following file:
> 
> ./script/process_archives.sh:rake utils:process_archives 
> DIR="/var/www/virtual/xxxx/htdocs/xxxx/tmp" RAILS_ENV="production"
> 
> The Rakefile looks like this:
> 
> require File.expand_path('../config/application', __FILE__)
> 
> XXXX::Application.load_tasks
> 
> Thanks for any help!
> 
> -- 
> Robert
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/546B909F.8060606%40webtent.org.
> For more options, visit https://groups.google.com/d/optout.
> 

----

Jason Fleetwood-Boldt
t...@datatravels.com
http://www.jasonfleetwoodboldt.com/writing

All material © Jason Fleetwood-Boldt 2014. Public conversations may be turned 
into blog posts (original poster information will be made anonymous). Email 
ja...@datatravels.com with questions/concerns about this.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/65B0E024-3594-48E7-B1DA-97F88A62D7D7%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to