ruby on rails - Capistrano: Gem bundler is not installed -


capistrano raises error "error: gem bundler not installed, run gem install bundler first."

but when clone project /tmp/project of targe server bundle runs (as root) smoothly.

the server ubuntu 12.04.2 lts, ruby installed via rvm.

i added "source /usr/local/rvm/scripts/rvm" /root/.bashrc did not solve problem.

require "bundler/capistrano"  set :application, 'myproject' set :repository,  "git@myproject.git" set :branch, 'staging' set :user, 'root' set :domain, "mydomain" set :deploy_to, "/var/webapps/#{application}"  role :web, domain                   # http server, apache/etc role :app, domain                   # may same `web` server role :db,  domain, :primary => true # rails migrations run role :db,  domain  default_run_options[:pty] = true  # [and tasks] 

tia.

edit same deploy script worked in server, ruby installed in same way. difference remember that server centos.

also tried rvm wrapper rvm current bundle bundle suggested here

edit 2

i compared env command via ssh , via capistrano. following env variables missing when env issued capistrano:

__array_start=0 _first=0 _second=1 escape_flag=1 gem_home=/usr/local/rvm/gems/ruby-1.9.3-p392 gem_path=/usr/local/rvm/gems/ruby-1.9.3-p392:/usr/local/rvm/gems/ruby-1.9.3-p392@global irbrc=/usr/local/rvm/rubies/ruby-1.9.3-p392/.irbrc lc_address=pt_br.utf-8 lc_identification=pt_br.utf-8 lc_measurement=pt_br.utf-8 lc_monetary=pt_br.utf-8 lc_name=pt_br.utf-8 lc_numeric=pt_br.utf-8 lc_paper=pt_br.utf-8 lc_telephone=pt_br.utf-8 lc_time=pt_br.utf-8 lessclose=/usr/bin/lesspipe %s %s lessopen=| /usr/bin/lesspipe %s ls_colors=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36: my_ruby_home=/usr/local/rvm/rubies/ruby-1.9.3-p392 ruby_version=ruby-1.9.3-p392 rvm_bin_path=/usr/local/rvm/bin rvm_debug_clr= rvm_error_clr= rvm_notify_clr= rvm_path=/usr/local/rvm rvm_prefix=/usr/local rvm_reset_clr= rvm_version=1.19.5 (stable) rvm_warn_clr= 

the following env vars different:

_=/usr/bin/env   # ssh _=/bin/sh        # capistrano lang=en_us.utf-8 # ssh lang=c           # capistrano language=en      # ssh language=c       # capistrano # ssh path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/rvm/bin # capistrano path=/usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 

i had similar problem 1 of setups, though use rbenv manage ruby versions. issue bundler not installed on ruby version project pointing to.

i did quick check online , have few options:

  1. run rvm gemset use global && gem install bundler (installs global version)
  2. edit /.bashrc ... along lines ([[ -s "$home/.rvm/scripts/rvm" ]] && . "$home/.rvm/scripts/rvm")
  3. running gem env may show you forcing path, , need remove entry ~/.gemrc or /etc/gemrc

my 2-cents


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -