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

后端 未结 9 1843
别那么骄傲
别那么骄傲 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:26

    I think you should execute

    apt-get install git-core
    

    at your server

    0 讨论(0)
  • 2021-02-02 09:29

    I was facing the same error.After trying hard to resolve it, i remembered that i have removed few packages randomly from my server where i was deploying the code.

    So i also removed git accidently.Running sudo apt-get install git fixed it .

    0 讨论(0)
  • 2021-02-02 09:34

    I had the same problem using rbenv. What solved it for me was including the rbenv library before bundler--not after it. The order turned out to be important. Here's what's in my Capfile:

    require 'capistrano/rbenv'
    require 'capistrano/bundler'
    

    If you did it right you should see the bundle command executed with the rbenv prefix, along these lines:

    XX RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.3.0 $HOME/.rbenv/bin/rbenv exec bundle install ...
    
    0 讨论(0)
  • 2021-02-02 09:36

    Solution to ERROR:

    /usr/bin/env git no such file or directory capistrano

    Install git in remote server, machine to which deployment is to be done.

    apt-get install git
    
    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-02-02 09:39

    Make sure you are requiring all of these gems in your Capfile.

    0 讨论(0)
提交回复
热议问题