【问题标题】:Terminal .bash_profile was messed up. How to revert?终端 .bash_profile 搞砸了。如何还原?
【发布时间】:2013-09-24 06:35:26
【问题描述】:

我正在关注如何在 Rails 上设置 ruby​​ 的教程。 http://blog.parsalabs.com/blog/2013/08/27/setting-up-a-ruby-on-rails-4-development-environment-on-a-clean-mac-os-x-installation/

我跑了:

$ brew install rbenv

$ touch ~/.bash_profile

$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

现在我的终端已经停止工作了。

$ emacs ~/.bash_profile

-bash:emacs: 找不到命令

当我打开一个新的终端窗口时。我收到以下消息:

Last login: Mon Sep 23 23:25:39 on ttys001
-bash: n: command not found
export     PATH=/usr/local/bin:/Users/Marcus/.local/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
-bash: export: `export PATH="/Users/Marcus/.rbenv/shims:${PATH}"
source "/usr/local/Cellar/rbenv/0.4.0/libexec/../completions/rbenv.bash"
rbenv rehash 2>/dev/null
rbenv() {
  typeset command
  command="$1"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
  rehash|shell)
    eval `rbenv "sh-$command" "$@"`;;
  *)
    command rbenv "$command" "$@";;
  esac
}': not a valid identifier

【问题讨论】:

  • 删除你的.bash_profile并重新开始
  • root 登录并删除旧配置文件,或重新启动到单用户模式并执行此操作。
  • 虽然在尝试设置您的开发环境时发生了这种情况,但这个问题对于 Stack Overflow 来说是题外话,在superuser.com 上可能会做得更好。

标签: ruby-on-rails ruby emacs terminal .bash-profile


【解决方案1】:

谢谢叶夫根尼·安菲洛夫耶夫,

解决方案是使用 TinkerTools 并删除我的 ~/.bash_profile

然后重新开始

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-10
    • 2010-10-15
    相关资源
    最近更新 更多