In many cases, cap won't be loading your .bashrc (or other rc scripts). (This has been talked to death in other threads, so if you're curious about the reasons, please feel free to search the list.)

So, if you've got some stuff set in your .bashrc files that are expecting to be loaded, that's probably why.

- Jamis

On Sep 3, 2008, at 10:26 AM, robert.najlis wrote:


I got capistrano up to 2.5 (I really should have checked on that
earlier).

I got the error on running saying that the chronic gem was not found,
however, on running the rake task from the command line (in the
correct current_path directory) it did work just fine.  Is there
something in the startup of capistrano that does not load my full
environment?  Or could it somehow load a different environment?  I'm
not  sure why the chronic gem would not be found when running via
capistrano, but it is found from the command line.

By the way, I am using Mac OS X 10.5, not sure if that makes any
difference.  I am testing the deploy on my local machine before
putting it on the production server (which is redhat linux).

here is the error message I received:

 * executing "cd /data/web/current && sudo -p 'sudo password: ' rake
ultrasphinx:daemon:start RAILS_ENV=production"
   servers: ["localhost"]
   [localhost] executing command
*** [err :: localhost] rake aborted!
*** [err :: localhost] no such file to load -- chronic
*** [err :: localhost]
*** [err :: localhost] (See full trace by running task with --trace)
** [out :: localhost] (in /data/web/releases/20080903161844)
** [out :: localhost] sudo gem install rcov # if you want the rcov
tasks
   command finished
failed: "sh -c \"cd /data/web/current && sudo -p 'sudo password: '
rake ultrasphinx:daemon:start RAILS_ENV=production\"" on localhost


thanks a lot for your help!

;Robert




On Sep 3, 11:58 am, Jamis Buck <[EMAIL PROTECTED]> wrote:
What version of Capistrano are you using? The inline sudo won't work
prior to cap 2.4.

- Jamis

On Sep 3, 2008, at 9:43 AM, robert.najlis wrote:



Thanks a lot for the reply.  Unfortunately this did not quite do the
trick. I got a 0 for 1 args error for sudo. So I tried it this way:

run "cd #{current_path} && #{sudo('ultrasphinx:daemon:stop rake
RAILS_ENV=production')}"

but the I got the no rakefile found problem again...

trying it then just with the run command, and running as root, I got a
problem saying that a gem required (for running ultrasphinx --
chronic) was not found.  So that makes me think that maybe the
environment is not being set up correctly, or that something different
is happening in the ruby environment for capsitrano that I am not
aware of.

Is there something I am missing?  Maybe in the setup of capistrano?

Thanks a lot.

Robert

On Sep 2, 9:42 pm, Jamis Buck <[EMAIL PROTECTED]> wrote:
Try this:

   run "cd #{current_path} && #{sudo} rake RAILS_ENV=production
ultrasphinx:daemon:stop"

Doing it as a sudo() call results in the following command:

   sudo cd #{current_path} && rake ...

Which does the cd as sudo, and the rake as not-sudo...

- Jamis

On Sep 2, 2008, at 5:01 PM, robert.najlis wrote:

Sorry if this is an old issue, but I have been searching, and have
been unable to find an answer for this.

I am trying to call a rake task from my capistrano script

The command I am using is
sudo "cd #{current_path} && RAILS_ENV=production rake
ultrasphinx:daemon:stop"

However, I get the following error:

[out :: localhost] rake aborted!
** [out :: localhost] No Rakefile found (looking for: rakefile,
Rakefile, rakefile.rb, Rakefile.rb)
** [out :: localhost] /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/
rake.rb:2143:in `raw_load_rakefile'
** [out :: localhost] (See full trace by running task with -- trace)
   command finished

I have tried doing things in the deploy.rb file such as setting the
rake file with comands like

set :rake, "rake -f rails/Rakefile"

but to no avail

If anyone has any ideas I would be most appreciative

Thanks a lot.

Robert

 smime.p7s
3KViewDownload




 smime.p7s
3KViewDownload

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to