简体   繁体   English

重新安装ruby后运行“捆绑安装”时收到bash错误消息

[英]I get a bash error message when I run “bundle install” after re-installing ruby

I removed the previous version of ruby I installed, ruby 1.9.1 to be precise, on my Ubuntu, and installed version 2.2.3. 我删除了以前安装的ruby版本,确切地说是在Ubuntu上安装了ruby 1.9.1,并安装了版本2.2.3。 When I try to run bundle install on my terminal, I get this error 当我尝试在终端上运行捆绑安装时,出现此错误

bash: /usr/local/bin/bundle: /usr/bin/ruby1.9.1: bad interpreter: No such file or directory. bash:/ usr / local / bin / bundle:/usr/bin/ruby1.9.1:错误的解释器:没有这样的文件或目录。

Can anyone advice on how to fix it? 谁能建议如何修复它?

How did you remove the old version of Ruby? 您如何删除旧版本的Ruby?

It looks like it left the binary executable for bundler , so I'm guessing you just straight up deleted the usr/bin/ruby folder? 看来它bundler二进制可执行文件留给bundler ,所以我猜您只是直接删除了usr/bin/ruby文件夹? Ruby installations (and most installations) tend to create executable binaries in other folders that need to be deleted as well. Ruby安装(和大多数安装)往往会在其他需要删除的文件夹中创建可执行二进制文件。

I would highly recommend that you use something like rvm or rbenv to manage multiple versions of ruby on your system. 强烈建议您使用rvmrbenv类的东西来管理系统上的多个版本的ruby。 Those tools are designed to do that sort of thing and are basically industry standard at this point. 这些工具旨在执行此类操作,并且在这一点上基本上是行业标准。

My personal recommendation is rvm , although either is really fine. 我个人的建议是rvm ,尽管两者都很好。 If you choose to go with that, check out rvm.io for installation instructions. 如果选择这样做,请查看rvm.io以获得安装说明。

It'll install rvm with the latest ruby version. 它将使用最新的ruby版本安装rvm In addition to that you are free to install any other version of ruby or patch that you prefer, and you can easily switch between the two using rvm use <ruby version> 除此之外,您还可以自由安装所需的任何其他版本的ruby或修补程序,并且可以使用rvm use <ruby version>轻松地在两者之间切换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM