麻烦重新安装红宝石

问题描述 投票:0回答:1

我在我的计算机上安装了RVM和RBENV,我决定只保留RBENV所以我跟着这个setup我在Mac上与高山脉

  • 我面临的第一个麻烦是ruby -v什么也没显示。我知道我的红宝石版本是好的因为ohmyzsh [2.4.4]
  • 当我尝试运行此命令时,gem install rake bundler rspec rubocop pry pry-byebug hub colored octokitnothing发生...我无法安装bundler也不能使用rails ....我不应该使用sudo ...有什么可能是错的,我怎么能找到解决这个问题?我甚至无法发射irbgem install bundlerdoes

某处肯定存在冲突?

我跑了这个dignostic

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   320  100   320    0     0    858      0 --:--:-- --:--:-- --:--:--   860
--- PATH ---
./bin:/Users/bill/.rbenv/shims:/usr/local/opt/rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/ImageMagick/bin:/usr/local/sbin
--- RBENV ---
rbenv is /usr/local/opt/rbenv/bin/rbenv
rbenv is /usr/local/bin/rbenv
  system
* 2.4.4 (set by /Users/bill/.rbenv/version)
--- RUBY ---
ruby is /Users/bill/.rbenv/shims/ruby
ruby is /usr/bin/ruby
ruby is /usr/local/bin/ruby
--- GEM ---
gem is /Users/bill/.rbenv/shims/gem
gem is /usr/bin/gem
gem is /usr/local/bin/gem
--- POSTGRES ---
postgres is /usr/local/bin/postgres
postgres (PostgreSQL) 10.5
2018-09-11 17:04:51.406 CEST [30591] FATAL:  database files are incompatible with server
2018-09-11 17:04:51.406 CEST [30591] DETAIL:  The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.5.

看我的.zshrc

ZSH=$HOME/.oh-my-zsh

# You can change the theme with another one:
#   https://github.com/robbyrussell/oh-my-zsh/wiki/themes
ZSH_THEME="robbyrussell"

# Add ruby version on prompt (float right)
if [ -x "$(command -v rbenv)" ]; then RPS1='[$(ruby_prompt_info)]$EPS1'; fi

# Useful plugins for Rails development with Sublime Text
plugins=(gitfast brew rbenv last-working-dir common-aliases sublime zsh-syntax-highlighting history-substring-search)

# Prevent Homebrew from reporting - https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Analytics.md
export HOMEBREW_NO_ANALYTICS=1

# Actually load Oh-My-Zsh
source "${ZSH}/oh-my-zsh.sh"

# Rails and Ruby uses the local `bin` folder to store binstubs.
# So instead of running `bin/rails` like the doc says, just run `rails`
export PATH="./bin:${PATH}:/usr/local/sbin"

# Store your own aliases in the ~/.aliases file and load the here.
[[ -f "$HOME/.aliases" ]] && source "$HOME/.aliases"

# Encoding stuff for the terminal
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export BUNDLER_EDITOR="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
export BUNDLER_EDITOR="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
export BUNDLER_EDITOR="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
eval "$(rbenv init -)"

还跑了这个diganostic

  You seem to have multiple rbenv installs in the following locations.
  Please pick just one installation and remove the others.

  /usr/local/opt/rbenv/bin/rbenv
  /usr/local/bin/rbenv

Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20180822)
Counting installed Ruby versions: 1 versions
Checking RubyGems settings: OK
Auditing installed plugins: %

这是我的~maybe的截图需要删除的东西?怎么样.rvmrc它说rvm_auto_reload_flag=1 rvm_auto_reload_flag=2 enter image description here

EDIT

我打开文件夹和文件:在.profileit中说:

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

澄清“没有发生”

  ~ gem install rake bundler rspec rubocop pry pry-byebug hub colored octokit

➜  ~
ruby-on-rails ruby rbenv
1个回答
0
投票

我修复了:

  • brew update
  • brew upgrade
  • brew uninstall ruby
© www.soinside.com 2019 - 2024. All rights reserved.