rbenv and bundler: “bad interpreter: No such file or directory”

后端 未结 2 1693
礼貌的吻别
礼貌的吻别 2021-02-12 23:09

I messed up my configuration. I am running Ubuntu 14.04 and had some issues when I tried to move from a project to an other. I tried to uninstall and reinstall rbenv and then in

相关标签:
2条回答
  • 2021-02-12 23:21

    The fact that gem is being executed by your /usr/local/bin means that rbenv isn't in your $PATH correctly.

    Step 1:

    Please delete any references you have of rbenv in the following areas:

    • ~/.profile
    • ~/.bashrc
    • ~/.bash_profile
    • ~/.gemrc

    Step 2:

    Reinstall rbenv using these instructions. It won't override, it will simply update changes to your ~/.bash_profile. Once reinstalled close your terminal and reopen. Everything should work correctly at that time.

    Step 3:

    Verify that everything was installed correctly by executing cat ~/.bash_profile. You should see the following. If you do, you're good to go.

    export PATH="$HOME/.rbenv/bin:$PATH"
    eval "$(rbenv init -)"
    

    Many cudos to @theTinMan for recently helping me sort through my rbenv installation.

    0 讨论(0)
  • 2021-02-12 23:22

    Find the bundle executable (in a non project directory - default system ruby) and delete it:

    which bundle

    rm <path_obtained_above>

    Now go to your project directory, or switch to your ruby version and install bundler:

    gem install bundler

    Then execute rbenv rehash

    and now try executing bundle install and it should work. You will need to do this once for each ruby version installed.

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