麻烦重新安装红宝石

时间:2018-09-11 19:08:48

标签: ruby-on-rails ruby rbenv

我在计算机上安装了 RVM RBENV ,所以我决定只保留 RBENV ,所以我遵循了setup 我在Mac上具有较高的塞拉利昂

  • 我面临的第一个麻烦是ruby -v什么也不显示。 我知道我的红宝石版本还可以,因为ohmyzsh [2.4.4]

  • 当我尝试运行此命令gem install rake bundler rspec rubocop pry pry-byebug hub colored octokit时,什么都没发生...我无法安装捆绑器或导轨。...我不应该使用sudo ...可能是错误的我怎么能解决这个问题? 我什至无法启动irb并且gem install bundler什么也没做

某处一定有冲突?

我运行了这个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: %

这是我的~的屏幕截图,也许需要删除某些内容?那.rvmrcrvm_auto_reload_flag=1 rvm_auto_reload_flag=2呢? enter image description here

编辑

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

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

➜  ~

1 个答案:

答案 0 :(得分:0)

我固定为:

  • brew update
  • brew upgrade
  • brew uninstall ruby