Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8099643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:28:38+00:00 2026-06-05T22:28:38+00:00

I am getting an error while deploying code for the first time. I used

  • 0

I am getting an error while deploying code for the first time. I used the same script so many times, and it worked successfully.

Error I am getting while deployment:

 [out :: ***********] sh: rake: not found

I am using RVM, Ruby 1.9.2

Deploy script output:

  executing `deploy:after_symlink'
  * executing "cp /home/me/my_app/shared/database.yml /home/me/my_app/current/config/database.yml"
    servers: ["**************"]
    ["**************"] executing command
    command finished in 1204ms
  * executing `deploy:migrate'
  * executing "cd /home/me/my_app/current && rake db:migrate RAILS_ENV=production"
    servers: ["**************"]
   ["**************"] executing command
 ** [out :: ***********] sh: rake: not found  // Here is the issue
    command finished in 1023ms
*** [deploy:symlink] rolling back
  * executing "ls -x /home/me/my_app/releases"

Gem List: on server

gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.1.0, 3.0.10)
actionpack (3.1.0, 3.0.10)
activemodel (3.1.0, 3.0.10)
activerecord (3.1.0, 3.0.10)
activeresource (3.1.0, 3.0.10)
activesupport (3.1.0, 3.0.10)
arel (2.2.1, 2.0.10)
bcrypt-ruby (3.0.1)
builder (3.0.0, 2.1.2)
bundler (1.0.21)
daemon_controller (0.2.6)
erubis (2.7.0, 2.6.6)
fastthread (1.0.7)
hike (1.2.1)
i18n (0.6.0, 0.5.0)
mail (2.3.0, 2.2.19)
mime-types (1.16)
multi_json (1.0.3)
mysql2 (0.2.7)
passenger (3.0.9)
polyglot (0.3.2)
rack (1.3.4, 1.2.4)
rack-cache (1.0.3)
rack-mount (0.8.3, 0.6.14)
rack-ssl (1.3.2)
rack-test (0.6.1, 0.5.7)
rails (3.0.10)
railties (3.1.0, 3.0.10)
rake (0.9.2)
rdoc (3.9.4)
sprockets (2.0.2)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.30)

Script i am using to deploy:

set :stages, %w(production staging)
require 'capistrano/ext/multistage'

server "Server IP", :app, :web, :db, :primary => true

set(:application) { "app_name" }
set (:deploy_to) { "/home/binarymesh/#{application}" }
set :user, 'my_user'
set :keep_releases, 3
set :repository, "git@github.com:MyRepo"
set :use_sudo, false
set :scm, :git
default_run_options[:pty] = true
ssh_options[:forward_agent] = false
set :deploy_via, :remote_cache
set :git_shallow_clone, 1
set :git_enable_submodules, 1

namespace :deploy do
 desc "Restarting mod_rails with restart.txt"
 task :restart, :roles => :app, :except => { :no_release => true } do
   run "touch #{current_path}/tmp/restart.txt"
 end

 [:start, :stop].each do |t|
   desc "#{t} task is a no-op with mod_rails"
   task t, :roles => :app do ; end
 end

 desc "invoke the db migration"
 task:migrate, :roles => :app do
   send(run_method, "cd #{current_path} && rake db:migrate RAILS_ENV=#{stage} ")
 end


 desc "Deploy with migrations"
  task :long do
    transaction do
      update_code
      web.disable
      symlink
      migrate
    end

    restart
    web.enable
    cleanup
  end

 task :after_symlink, :roles => :app do
   run "cp #{shared_path}/database.yml #{current_path}/config/database.yml"
 end

  desc "Run cleanup after long_deploy"
  task :after_deploy do
    cleanup
  end

end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:28:40+00:00Added an answer on June 5, 2026 at 10:28 pm

    Adding this

    $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
    require 'capistrano/ext/multistage'
    require "rvm/capistrano"
    

    on top my deploy.rb file solved my problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While deploying a dwr web app, i'm continuously getting this error. I dont know
I am getting an error while trying to run CFmx code on a remote
I'm trying to compile some code. Here is the error I'm getting: error while
Getting this error while compiling C++ code: undefined reference to `__stack_chk_fail' Options already tried:
I am getting an error while assigning a value. My code is: protected bool
While deploying solution I am getting following error after changing the template name in
Getting this error while trying to compile a copied code from a Fortran 77
I am getting error while dynamic casting the below code. class CBase { };
getting error while try to start service
Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.