Topic: Ruby Error on Subversion code update

I'm trying to deploy a test application on the MT Grid server.

I've been able to add the application, and set it up but when I try to update the code into subversion I get the following error.

DEPLOY:~/documents/rails/myapp$ cap update_code
  * executing task update_code
  * querying latest revision...
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27: command not found: svn log -q --limit 1 svn+ssh://mylogin%mydomain@mydomain/home/siteno/data/repo/deploy
/usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/scm/subversion.rb:24:in `latest_revision': Could not determine latest revision (RuntimeError)
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/configuration.rb:62:in `initialize'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/configuration.rb:88:in `call'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/configuration.rb:88:in `[]'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/configuration.rb:235:in `method_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/scm/subversion.rb:64:in `checkout'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/recipes/standard.rb:71:in `load'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/actor.rb:159:in `instance_eval'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/actor.rb:159:in `update_code'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/cli.rb:271:in `send'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/cli.rb:271:in `execute_recipes!'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/cli.rb:271:in `each'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/cli.rb:271:in `execute_recipes!'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/cli.rb:247:in `execute!'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/lib/capistrano/cli.rb:12:in `execute!'
        from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.3.1/bin/cap:11
        from /usr/local/bin/cap:18:in `load'
        from /usr/local/bin/cap:18

I've added the start of the file where the error occurs

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27: command not found

#++

require 'rubygems/source_index'

module Kernel
  alias gem_original_require require

  #
  # We replace Ruby's require with our own, which is capable of
  # loading gems on demand.
  #
  # When you call <tt>require 'x'</tt>, this is what happens:
  # * If the file can be loaded from the existing Ruby loadpath, it
  #   is.
  # * Otherwise, installed gems are searched for a file that matches.
  #   If it's found in gem 'y', that gem is activated (added to the
  #   loadpath).
  #
  # The normal <tt>require</tt> functionality of returning false if
  # that file has already been loaded is preserved.
  #
  def require(path)
    gem_original_require path
  rescue LoadError => load_error
    begin
      @gempath_searcher ||= Gem::GemPathSearcher.new
      if spec = @gempath_searcher.find(path)
        Gem.activate(spec.name, false, "= #{spec.version}")
        gem_original_require path
      else
    raise load_error
      end
    end
  end
end  # module Kernel


Any ideas?

Last edited by sydneyfx (2007-01-22 10:45:00)

Re: Ruby Error on Subversion code update

It looks like the script can't run an "svn" command. Do you have subversion installed and can you run "svn" commands from the command line?

Railscasts - Free Ruby on Rails Screencasts

Re: Ruby Error on Subversion code update

I am having the same problem. And yes, I can run an svn command. I ran svn help.

Re: Ruby Error on Subversion code update

Are you getting this same "command not found" for svn error message, scottmotte?

Railscasts - Free Ruby on Rails Screencasts

Re: Ruby Error on Subversion code update

I've been meaning to have another crack at this problem. I've been doing a bit of reading up on subversion so I'll give this deployment another go today.

Re: Ruby Error on Subversion code update

I was able to fix a similar issue by specifying a set svn line in my deploy.rb configuration file.

under the "Optional Variables" section add the following line:

set :svn, "/path/to/svn"

where /path/to/svn is where your svn command resides, in my case /usr/local/bin/svn

Hope this helps,
Jake