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

后端 未结 9 1848
别那么骄傲
别那么骄傲 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条回答
  •  孤街浪徒
    2021-02-02 09:36

    When I typed bundle install interactively on a Terminal, it worked. Now, when I use it through Capistrano, it doesn't work.

    I solved it this way:

    In Ubuntu, 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 moving the lines of code that were required by bundle install above that block of code, so Capistrano could load them.

    You could get a hint of which lines to move by running which bundle.

提交回复
热议问题