Capistrano 3: Gems not installed into gemset during deployment

1,230 views
Skip to first unread message

John

unread,
Apr 4, 2014, 5:25:50 AM4/4/14
to capis...@googlegroups.com
Versions:
  • Ruby: 2.1.1p76
  • Capistrano: 3.1.0
  • Capistrano-rvm: 0.1.1
  • Rails: 4.1.0rc2
Platform:
  • Working on: Ubuntu
  • Deploying to: Ubuntu


Hi there,

I just deployed a Rails app using Capistrano 3 (and RVM, via the gem 'capistrano-rvm').

But Rails was not recognized:

     $ rails -v

...returned...

     The program 'rails' can be found in the following packages:
      * rails
      * ruby-railties-3.2
     Ask your administrator to install one of them


So I checked out Capistrano's debug log and saw it runs this command during deployment:

     /usr/local/rvm/bin/rvm default do bundle install --binstubs /home/deploy/shared/bin --path /home/deploy/shared/bundle --without development test --deployment --quiet

...and Rails (and all other gems) really are installed in: /home/deploy/shared/bundle
Now...

     $ rvm current

...returns...

     ruby-2.1.1@rails410rc2

...which (I believe) means that the gems should have been installed into: /usr/local/rvm/gems/ruby-2.1.1/gems - but they weren't: Rails (and the other gems) is not there.

Why does it install into "/home/deploy/shared/bundle"?
Aren't the gems 'capistrano' and 'capistrano-rvm' supposed to install into the "$ rvm current" gemset (or the one set in deploy), during deployment? (Specifying the gemset or not didn't change anything.)

What am I missing?

FWIW, in deploy.rb, I have specified:

     set :rvm_type, :system # system means: /usr/local/rvm
     set :rvm_ruby_version, 'ruby-2.1.1@rails410rc2'

John

unread,
Apr 4, 2014, 5:35:29 AM4/4/14
to capis...@googlegroups.com
PS:

When I explicitely specified the gemset in deploy.rb...

    set :rvm_ruby_version, 'ruby-2.1.1@rails410rc2'

...Capistrano ran...

    /usr/local/rvm/bin/rvm ruby-2.1.1@rails410rc2 do bundle install --binstubs /home/deploy/shared/bin --path /home/deploy/shared/bundle --without development test --deployment --quiet

...but there were only some basic gems installed there, not those on Gemfile/Gemfile.lock.

John

unread,
Apr 4, 2014, 5:59:50 AM4/4/14
to capis...@googlegroups.com
PS 2:

This is strange:

When Capistrano (at the beginning of the deployment) runs

    /usr/local/rvm/bin/rvm current
   
...it logs...
   
    ruby-2.1.1@rails410rc2

But when I do (after the deployment)...

    $ ls /home/deploy/shared/bundle/ruby

...it returns:

    2.1.0 (where it should be '2.1.1', right?)
   
I then deleted the directory '2.1.0' and re-deployed - same result: All gems are in this (newly re-created) folder, but only a few basic ones (not the content of the Gemfile) are inside /usr/local/rvm/gems/ruby-2.1.1/gems

Dan Auerbach

unread,
May 1, 2014, 12:18:16 PM5/1/14
to capis...@googlegroups.com
John,

I am hitting the behavior with ruby 2.0.0p247. I fell like I am missing something about how this is working, but can't figure it out.

Any help or insights greatly appreciated.

thx,
dan

Bruno Sutic

unread,
May 3, 2014, 4:42:34 PM5/3/14
to capis...@googlegroups.com
Hey guys,
are you using capistrano-bundler gem? I suppose yes.
You can check it's default settings on the project's webpage here.
Essentially, with it, gems are installed to the shared/bundle path, as you can read here.

Aside from that, there's been much written in the posts above.. but can you please say what are you trying to accomplish and is not working?
Reply all
Reply to author
Forward
0 new messages