由于我的路径,无法正确设置ruby和rails

时间:2023-01-24 17:49:18

Trying to bundle a rails project my company has set up for me, just installed everything onto a new computer. But keep running into this error:

试图捆绑我公司为我设置的rails项目,只需将所有内容安装到新计算机上。但是继续遇到这个错误:

Warning! PATH is not properly set up, '/Users/Name/.rvm/gems/ruby-2.1.0/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.1.0'.

警告!路径没有正确设置'/Users/Name/.rvm/gems/ruby-2.1.0/bin'不在第一位,通常这是由shell初始化文件引起的 - 检查它们是否为'PATH = ... '条目,它也可能有助于将RVM重新添加到你的dotfiles:'rvm get stable --auto-dotfiles',暂时修复此shell会话运行:'rvm use ruby​​-2.1.0'。

Doing which -a ruby gives me this:

做什么 - 红宝石给了我这个:

/Users/Name/.rvm/rubies/ruby-2.1.0/bin/ruby

/Users/Name/.rvm/rubies/ruby-2.1.0/bin/ruby

And

/usr/bin/ruby

在/ usr / bin中/红宝石

And when I echo my $PATH I get this:

当我回复我的$ PATH时,我得到了这个:

/usr/local/bin:/usr/local/sbin:~/bin:/Users/Name/.rvm/gems/ruby2.1.0/bin:/Users/Name/.rvm/gems/ruby2.1.0@global/bin:/Users/Name/.rvm/rubies/ruby2.1.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Name/.rvm/bin

/usr/local/bin:/usr/local/sbin:~/bin:/Users/Name/.rvm/gems/ruby2.1.0/bin:/Users/Name/.rvm/gems/ruby2.1.0@global/斌:/Users/Name/.rvm/rubies/ruby2.1.0/bin:在/ usr / bin中:/ bin中:/ usr / sbin目录:/ sbin目录:/Users/Name/.rvm/bin

Could anyone help me figure this issue out? I've looked online quite a bit and have yet to find a walkthrough or real in-depth explanation on how to fix this issue.

任何人都可以帮我解决这个问题吗?我在网上看了很多,还没有找到关于如何解决这个问题的演练或真正深入的解释。

1 个解决方案

#1


0  

See this answer to a similar question. You need to go through your terminal's config files (.bash_profile, .bashrc, .zshrc, etc).

看到类似问题的答案。您需要浏览终端的配置文件(.bash_profile,.bashrc,.zshrc等)。

Replace this line: export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting With this line: export PATH="$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting

替换此行:export PATH =“$ PATH:$ HOME / .rvm / bin”#将RVM添加到PATH以进行脚本编写使用以下行:export PATH =“$ HOME / .rvm / bin:$ PATH”#将RVM添加到PATH用于编写脚本

To make sure the RVM code is always at the start of $PATH

确保RVM代码始终位于$ PATH的开头

#1


0  

See this answer to a similar question. You need to go through your terminal's config files (.bash_profile, .bashrc, .zshrc, etc).

看到类似问题的答案。您需要浏览终端的配置文件(.bash_profile,.bashrc,.zshrc等)。

Replace this line: export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting With this line: export PATH="$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting

替换此行:export PATH =“$ PATH:$ HOME / .rvm / bin”#将RVM添加到PATH以进行脚本编写使用以下行:export PATH =“$ HOME / .rvm / bin:$ PATH”#将RVM添加到PATH用于编写脚本

To make sure the RVM code is always at the start of $PATH

确保RVM代码始终位于$ PATH的开头