【问题标题】:rbenv install gives ": No such file or directory" on ubuntu 14.04rbenv install 在ubuntu 14.04上给出“:没有这样的文件或目录”
【发布时间】:2016-06-27 16:53:58
【问题描述】:

道歉

这似乎是一个非常明显的问题......而且我确信它是重复的......我实际上已经在我的文件系统和网络上搜索过这个问题,但还没有找到“rbenv”的答案" 本身。

上下文

我尝试通过此链接在我的 ubuntu 14.04 机器上安装 rbenv:https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

问题

当 .bashrc 运行 ~/.rbenv/bin/rbenv 时,会出现以下错误:

: No such file or directory

直接运行时出现同样的错误:

~/.rbenv$  rbenv init -

检查过这个

我已经检查了脚本;第一行“#!/usr/bin/env bash”看起来不错。

但是,我不确定它在什么时候失败了。除了在脚本中添加一堆“echo”之外,我没有一个简单的方法来调试它。

提前致谢

【问题讨论】:

  • 你在使用 zsh 吗?因为在这种情况下,您应该使用 ~/.zshrc 重复这些步骤
  • 不:/etc/password 我的 shell 是“/bin/bash”
  • 检查你当前的shell输入echo $0
  • "echo $0" 输出 "bash"

标签: ruby bash ubuntu rbenv


【解决方案1】:

您是否有可能将 repo 克隆到 ~/.rbenv 以外的其他地方?

git clone git://github.com/sstephenson/rbenv.git .rbenv 应该 git clone git://github.com/sstephenson/rbenv.git ~/.rbenv

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-13
    • 2016-01-05
    • 2018-01-28
    • 1970-01-01
    • 1970-01-01
    • 2017-04-03
    • 1970-01-01
    相关资源
    最近更新 更多