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 8192697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:14:09+00:00 2026-06-07T04:14:09+00:00

EDIT: The issue here was that I used RVM on my local machine and

  • 0

EDIT:
The issue here was that I used RVM on my local machine and rbenv on the server. This is highly not recommended, if you’re managing several ruby installation (or upgrading your ruby version but do not want to change the system’s) use either RVM or rbenv on all environments!
/EDIT

So I’ll start with a bit history:
I’m in the process of upgrading our rails2 website to rails3. Most of the things are working properly by now, except Capistrano’s deploy script.
The current setup I have is:

  • RVM (1.14.1) installed locally
  • ruby-1.9.3-p194 (set to the project’s folder)
  • Capistrano v2.12.0 (upgraded from 2.6.0, but it doesn’t work on 2.6.0 as well) installed as an RVM gem
  • rvm-capistrano (1.2.2), added to the Gemfile (after doing some reading online and on SO)
  • rbenv (with ruby 1.9.3p194 used globally) installed on the server

(by now if you see anything that doesn’t make sense, please let me know)

Nothing changed in the deploy script, yet when I try to deploy to my testing server (let’s call it beta) I get this error:

* executing `deploy:restart'
* executing "cd /home/foo/bar/current && rake RAILS_ENV=beta queue:restart_workers"
        servers: ["208.0..."]
        [208.0...] executing command
    *** [err :: 208.0...] rake aborted!
    *** [err :: 208.0...] no such file to load -- bundler/setup
    *** [err :: 208.0...] /home/foo/bar/releases/20120630161947/Rakefile:5
    *** [err :: 208.0...] (See full trace by running task with --trace)
     ** [out :: 208.0...] (in /home/foo/bar/releases/20120630161947)
        command finished in 1183ms
    failed: "sh -c 'cd /home/foo/bar/current && rake RAILS_ENV=beta queue:restart_workers'" on 208.0...

The relevant part on deploy.rb looks like this:

  task :restart do
    run "cd /home/foo/bar/current && rake RAILS_ENV=#{CAP_ENV} queue:restart_workers"
    run "cd /home/foo/bar/current && rake RAILS_ENV=#{CAP_ENV} db:migrate"
    run "touch #{deploy_to}/current/tmp/restart.txt"
  end   

Needless to say, rake RAILS_ENV=beta queue:restart_workers' works perfectly when run manually on the server. Also, the application gets deployed (the code was copied from git, it’s just the last part of the deploy fails).

Lastly, the error didn’t change since before I installed rvm-capistrano and added to the Gemfile, so I’m not even sure it’s related to rvm, I’m just guessing from looking online.

Thanks

  • 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-07T04:14:10+00:00Added an answer on June 7, 2026 at 4:14 am

    In order to work correctly, rbenv must override all the ruby and gem-related executables with the shims it provides.

    Usually this is done with a startup script (this is why it works when you login to your server) but Capistrano logs in without shell and thus does not run those scripts.

    You must add the following to your deploy.rb :

    set :default_environment, {
      'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
    }
    

    and do not use anything rvm related on your server, rbenv and rvm really do not like each other

    PS : a little more explanation on this topic : http://henriksjokvist.net/archive/2012/2/deploying-with-rbenv-and-capistrano/

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

Sidebar

Related Questions

EDIT: Note to new Perl programmers : This mechanism should NOT be used for
EDIT: This issue is already submitted on Github. Changing the Act part to this
Edit: closing anchor fixed. This issue exists when testing on the following browsers: Google
As far as I read from here , the fact that captchas are not
Has anyone ran into this issue? We have a mobile site that can't use
EDIT After staring at this for 2 days, I do see one issue. I
This is my first question on here so here goes.... I've got an issue
EDIT: Apparently the question is not clearly formulated enough. The issue I am having
Okay, so I've had this code that used to work just fine. I recently
EDIT: My sincere apologies! This wasn't an issue with anything but myself - I

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.