I am trying to update my Ruby version with my rbenv and am having trouble installing 2.1.1. I have followed the instructions carefully but it does not seem to be working for some reason. Please let me know what I am doing wrong.
我正在尝试使用我的rbenv更新我的Ruby版本,并且在安装2.1.1时遇到问题。我已经仔细按照说明进行操作,但由于某些原因它似乎没有起作用。请让我知道我做错了什么。
Installed ruby-2.1.1 to /Users/user/.rbenv/versions/2.1.1
$
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$ rbenv rehash
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$ rbenv global 2.1.1
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$ rbenv global 2.1.1
$ rbenv rehash
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$ rbenv local 2.1.1
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$ rbenv versions
system
* 2.1.1 (set by /Users/user/.ruby-version)
$ rbenv global 2.1.1
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$
Any thoughts on what's going on?
对于发生了什么的任何想法?
not sure if this helps get to the root of the issue..
不确定这是否有助于找到问题的根源..
PATH=usr/local/bin:/urs/local/sbin:/usr/local/mysql/bin:usr/local/bin:/urs/local/sbin:/usr/loca /mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
\$ ~/.bash_profile
-bash: /Users/user/.bash_profile: Permission denied
$ ~/.bash_profile
-bash: /Users/user/.bash_profile: Permission denied
$ export PATH="$HOME./rbenv/bin:$PATH"
$ "$(rbenv init -)"
-bash: export PATH="/Users/user/.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
}: No such file or directory
1 个解决方案
#1
3
Sigh... first, take a close look at your path:
叹息......首先,仔细看看你的路径:
PATH=usr/local/bin:/urs/local/sbin:/usr/local/mysql/bin:usr/local/bin:/urs/local/sbin:/usr/loca /mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
You have multiple definitions for the same directories, and, in addition have what are very likely invalid directory names:
您有相同目录的多个定义,此外还有很可能无效的目录名称:
-
usr/local/bin
should be/usr/local/bin
.usr/local/bin
is a relative directory name, which would usually be invalid anywhere unless you're in your/
directory. This is in the path multiple times, so remove all but the middle one and fix the name. - usr / local / bin应该是/ usr / local / bin。 usr / local / bin是一个相对目录名,除非你在/目录中,否则它通常在任何地方都是无效的。这是在路径中多次,因此除了中间的一个并删除所有名称。
-
/urs/local/sbin
is probably a misspelled directory/usr/local/sbin
, but, at the same time, you probably shouldn't have a.../sbin
directory in your path because you'll seldom use the files in there. That particular directory is in your path twice, so remove at least one. - / urs / local / sbin可能是一个拼写错误的目录/ usr / local / sbin,但是,同时,你的路径中可能不应该有一个... / sbin目录,因为你很少使用这些文件那里。该特定目录在您的路径中两次,因此至少删除一个。
-
/usr/loca /mysql/bin
is totally invalid so remove it. If you are using MySQL, then fix that entry; It's probably/usr/local/share/mysql/bin
, but confirm that and adjust as necessary. - / usr / loca / mysql / bin完全无效,请将其删除。如果您使用的是MySQL,请修复该条目;它可能是/ usr / local / share / mysql / bin,但请确认并根据需要进行调整。
You're using
你正在使用
export PATH="$HOME./rbenv/bin:$PATH"
which is not a valid definition for PATH. $HOME
would normally look like /home/user
, without a terminating or delimiting /
. Using $HOME./rbenv...
would result in /home/user./rbenv...
which isn't valid.
这不是PATH的有效定义。 $ HOME通常看起来像/ home / user,没有终止或分隔/。使用$ HOME。/ rbenv ...会导致/home/user./rbenv ...无效。
rbenv needs a chance to initialize when your shell session starts. To do that it expects you to add
当shell会话启动时,rbenv需要初始化的机会。要做到这一点,它希望你添加
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
to your ~/.bash_profile file as the very last lines. It's obvious that hasn't been done because your path would reflect that if it had. Mine starts with a reference to rbenv's shim, then bin directories.
作为最后一行的〜/ .bash_profile文件。显而易见的是,没有这样做,因为如果有的话,你的路径会反映出来。我首先参考rbenv的垫片,然后是bin目录。
I have followed the instructions carefully but it does not seem to be working for some reason.
我已经仔细按照说明进行操作,但由于某些原因它似乎没有起作用。
I'd strongly recommend you read the rbenv documentation for setting it up.
我强烈建议您阅读rbenv文档以进行设置。
#1
3
Sigh... first, take a close look at your path:
叹息......首先,仔细看看你的路径:
PATH=usr/local/bin:/urs/local/sbin:/usr/local/mysql/bin:usr/local/bin:/urs/local/sbin:/usr/loca /mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
You have multiple definitions for the same directories, and, in addition have what are very likely invalid directory names:
您有相同目录的多个定义,此外还有很可能无效的目录名称:
-
usr/local/bin
should be/usr/local/bin
.usr/local/bin
is a relative directory name, which would usually be invalid anywhere unless you're in your/
directory. This is in the path multiple times, so remove all but the middle one and fix the name. - usr / local / bin应该是/ usr / local / bin。 usr / local / bin是一个相对目录名,除非你在/目录中,否则它通常在任何地方都是无效的。这是在路径中多次,因此除了中间的一个并删除所有名称。
-
/urs/local/sbin
is probably a misspelled directory/usr/local/sbin
, but, at the same time, you probably shouldn't have a.../sbin
directory in your path because you'll seldom use the files in there. That particular directory is in your path twice, so remove at least one. - / urs / local / sbin可能是一个拼写错误的目录/ usr / local / sbin,但是,同时,你的路径中可能不应该有一个... / sbin目录,因为你很少使用这些文件那里。该特定目录在您的路径中两次,因此至少删除一个。
-
/usr/loca /mysql/bin
is totally invalid so remove it. If you are using MySQL, then fix that entry; It's probably/usr/local/share/mysql/bin
, but confirm that and adjust as necessary. - / usr / loca / mysql / bin完全无效,请将其删除。如果您使用的是MySQL,请修复该条目;它可能是/ usr / local / share / mysql / bin,但请确认并根据需要进行调整。
You're using
你正在使用
export PATH="$HOME./rbenv/bin:$PATH"
which is not a valid definition for PATH. $HOME
would normally look like /home/user
, without a terminating or delimiting /
. Using $HOME./rbenv...
would result in /home/user./rbenv...
which isn't valid.
这不是PATH的有效定义。 $ HOME通常看起来像/ home / user,没有终止或分隔/。使用$ HOME。/ rbenv ...会导致/home/user./rbenv ...无效。
rbenv needs a chance to initialize when your shell session starts. To do that it expects you to add
当shell会话启动时,rbenv需要初始化的机会。要做到这一点,它希望你添加
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
to your ~/.bash_profile file as the very last lines. It's obvious that hasn't been done because your path would reflect that if it had. Mine starts with a reference to rbenv's shim, then bin directories.
作为最后一行的〜/ .bash_profile文件。显而易见的是,没有这样做,因为如果有的话,你的路径会反映出来。我首先参考rbenv的垫片,然后是bin目录。
I have followed the instructions carefully but it does not seem to be working for some reason.
我已经仔细按照说明进行操作,但由于某些原因它似乎没有起作用。
I'd strongly recommend you read the rbenv documentation for setting it up.
我强烈建议您阅读rbenv文档以进行设置。