本文介绍了麻烦从头重新安装Ruby的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 rvm (Ruby Version Manager),并通过运行 gem update --system 命令。我有一些严重的问题,所以我决定在本地机器上重新安装 rvm ruby​​ 1.9.2 (MacOS Snow Leopard

现在,如果我运行 rails s 命令,我会得到以下内容

  $ rails s 
/Library/Ruby/Site/1.8/rubygems.rb:779:in`report_activate_error':Could not find RubyGem rails(> = 0)(Gem :: LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:214:in`activate'
from / Library / Ruby / Site / 1.8 / ruby​​gems.rb:1082:在`gem'
从/ usr / bin / rails:18

我能做些什么来解决这个问题?




其他命令输出是:

  $ which ruby​​ 
/Users/<my_username>/.rvm/rubies/ruby-1.9.2 -p136 / bin / ruby​​

$ type rvm | head -1
rvm是一个函数


解决方案

这应该给你一个干净的1.9.2安装与铁轨:

  $ rvm删除1.9.2 
$ rvm install 1.9.2
$ rvm使用1.9.2 - 默认
$ gem install rails


I am using rvm (Ruby Version Manager) and I deleted some gems by running the gem update --system command. I had some serious problem so I decided to reinstall rvm and ruby 1.9.2 on my local machine (MacOS Snow Leopard 10.6.7).

Now, if I run therails s command I get the following

$ rails s
/Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:214:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1082:in `gem'
from /usr/bin/rails:18

What I can do to solve the problem?


Other command outputs are:

$ which ruby
/Users/<my_username>/.rvm/rubies/ruby-1.9.2-p136/bin/ruby

$ type rvm | head -1
rvm is a function
解决方案

This should give you a clean 1.9.2 install with rails:

$ rvm remove 1.9.2
$ rvm install 1.9.2
$ rvm use 1.9.2 --default
$ gem install rails

这篇关于麻烦从头重新安装Ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 06:38