/usr/bin/env ruby no such file or directory: Using capistrano 3, capistrano/rbenv, capistrano/bundler and capistrano/rails (using rails 4)

后端 未结 9 1851
别那么骄傲
别那么骄傲 2021-02-02 08:45

I\'m using capistrano, capistrano/rbenv, capistrano/bundler and capistrano/rails. I get this error in the step where capistrano compiles the assets:

DEBUG [49a50         


        
9条回答
  •  -上瘾入骨i
    2021-02-02 09:39

    My problem is:

    DEBUG [3132b2c2]    /usr/bin/env: ‘bundle’: No such file or directory
    DEBUG [3132b2c2] 
    

    I solved it this way:

    In Debian, there is a block of code in your ~/.bashrc that says:

    # If not running interactively, don't do anything
    
    case $- in
       *i*) ;;
         *) return;;
    esac
    

    When you run Capistrano, it will actually use your ~/.bashrc but it will not run any command below that block of code.

    So, I fixed the problem adding the lines of code that were required by load ruby environment above that block of code, so Capistrano could load bundle.

    source /usr/local/share/chruby/chruby.sh
    source /usr/local/share/chruby/auto.sh
    

    PS:I use chruby in my server.

提交回复
热议问题