bundle install error没有这样的文件或目录

时间:2015-02-19 11:38:00

标签: ruby-on-rails ruby bundle

当我尝试在rails app中安装gem时显示我的错误:

-bash: /usr/local/bin/bundle: /usr/local/opt/ruby/bin/ruby: bad interpreter: No such file or directory

知道为什么会这样,以及如何修复?

感谢。

1 个答案:

答案 0 :(得分:1)

对我来说,这是我的路径设置,正如rvm

所揭示的那样
rvm list

输出:

Warning! PATH is not properly set up, '/Users/user/.rvm/gems/ruby-2.2.6/bin' is not at first place,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-2.2.6'.

rvm rubies

=* ruby-2.2.6 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

在检查我的PATH之前,我运行了建议的命令:

rvm use ruby-2.2.6

之后,bundle命令运行正常。然后我找到了PATH已损坏的地方,并修复了该问题。