Jason Fleetwood-Boldt wrote:
Without seeing the task I can't tell you the answer to that. And the fact that
it runs on a cron schedule means that you probably have something like a worker
in the background doing that.
Normally you run
rake some_task X="abc" Y="xyz"
I see this piece of code at the start of the task assuming an argument
could be used to get the verbose response....
@verbose = false
ARGV.each do |arg|
puts "arg: #{arg}"
@verbose = false # if arg == 'V'
end
Then the code uses '#puts something if @verbose' throughout. Like I
said, I'm new to ruby, but have used Perl and PHP and other languages
before, I hope is what is throwing me off is the # are not comments?
This almost looks like @verbose would always be false. What is this
piece of code looking for as an argument?
I apologize for trying to get a crash course in ruby here, gonna have to
get up to speed soon as this app that was left to me to try and
maintain/support. I am reading through the following tutorial to get up
to speed as quickly as I can, any other pointers extremely helpful...
https://www.railstutorial.org/book
But note that you probably want to prefix the rake task in development with "bundle
exec" to get it to run with the right gemset.
I downloaded a copy of the app and setup locally on a development
server. The production app is running on nginx web server and have the
copy running on Apache locally. I saw the following directive available
in the nginx conf to enable development, copied to Apache and this is
how I am running dev mode...
RailsEnv development
Then I can run "bundle exec rake utils:process_archives"?
As I posted earlier, there is a script/process_archives.sh file that I
thought at first runs the rake task since I see results of the task in
the cron log...
rake utils:process_archives DIR="/var/www/virtual/xxxx/htdocs/xxxx/tmp"
RAILS_ENV="production"
But that DIR does not exist on the server, so I'm questioning if this
shell script is being used at all. I found further the task in
config/schedule.rb...
command %{#{cmd_root} && cd /var/www/vhosts/wmnf/current && bundle exec
rake utils:process_archives DIR="/var/www/vhosts/xxxx/shared/tmp"
RAILS_ENV=production}
Those dirs do exist and I also found in the crontabs...
root@app01:~/www# cat /var/spool/cron/crontabs/appuser |grep process
31 * * * * /bin/bash -l -c 'PATH=/opt/ree/bin:$PATH && cd
/var/www/vhosts/xxxx/current && bundle exec rake utils:process_archives
DIR="/var/www/vhosts/xxxx/shared/tmp" RAILS_ENV=production >>
/var/www/vhosts/xxxx/shared/log/cron.log 2>&1'
Is the scheduler.rb being used at all?
Another thing about running the app locally on a development server is
when I enable development as shown above, it breaks links to images,
css, etc. Seems there is something in the code to prefix the paths of
those resources with '/app_development/' when using development
environment. So, I'm running in production environment on the
development server. Other than references like this in the code for
development, what would be the difference between running a copy of the
app under the production or development environment on the development
server?
Again, thanks a ton for any help and patience, I promise to get up to
speed as quickly as possible.
--
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/546CD828.7000000%40webtent.org.
For more options, visit https://groups.google.com/d/optout.