当我尝试在rails app中安装gem时显示我的错误:
-bash: /usr/local/bin/bundle: /usr/local/opt/ruby/bin/ruby: bad interpreter: No such file or directory
知道为什么会这样,以及如何修复?
感谢。
答案 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
已损坏的地方,并修复了该问题。