安装RVM后Ruby on Rails Mac OSX Mavericks问题 [英] Ruby on Rails Mac OSX Mavericks issues after RVM install

查看:392
本文介绍了安装RVM后Ruby on Rails Mac OSX Mavericks问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经学习Ruby on Rails几个月了,一切都正常.

I have been learning Ruby on Rails for a couple of months, and everything was working.

然后,出于教程的需要,我尝试安装RVM,以便将安装程序降级到Ruby和Rails的旧版本.

Then, for the needs of a tutorial, I tried to install RVM, in order to downgrade my setup to older versions of Ruby and Rails.

从那以后,我一直遇到麻烦.

And since then, I kept running into troubles.

例如,每当我启动一个新的终端会话时,这就是我得到的:

For instance, anytime I launch a new Terminal session, here is what I get:

You are using '.rvmrc', it requires trusting, it is slower and it is not compatible with other ruby managers,
you can switch to '.ruby-version' using 'rvm rvmrc to [.]ruby-version'
or ignore this warning with 'rvm rvmrc warning ignore /Users/Thibaud/work/.rvmrc',
'.rvmrc' will continue to be the default project file in RVM 1 and RVM 2,
to ignore the warning for all files run 'rvm rvmrc warning ignore all.rvmrcs'.

ree-1.8.7-2012.02 - #gemset created /Users/Thibaud/.rvm/gems/ree-1.8.7-2012.02@tedxperth
ree-1.8.7-2012.02 - #generating tedxperth wrappers....................
Using /Users/Thibaud/.rvm/gems/ree-1.8.7-2012.02 with gemset tedxperth
Warning! Executable 'ruby' missing, something went wrong with this ruby installation!
Warning! Executable 'gem' missing, something went wrong with this ruby installation!
Warning! Executable 'irb' missing, something went wrong with this ruby installation!

两个问题:

  1. 如何解决终端中出现的错误? (请参见上文)

  1. How can I resolve the errors appearing in my Terminal? (see above)

由于我不知道安装过程中发生了什么问题,因此我想知道是否应该取消整个Ruby on Rails环境的安装,然后重新设置它以进行全新安装:这是一个好主意吗?如果是这样,如何实现?

Since I do not know what got broken in my install, I am wondering whether I should unsintall the whole Ruby on Rails environment and set it up again to get a clean install: Is this a good idea? If so, how can it be achieved?

推荐答案

如果您删除项目目录中隐藏的.rvmrc文件,您的第一组错误将消失:

Your first set of errors will go away if your remove the hidden .rvmrc file in your project directory:

$ rm .rvmrc

当您cd进入目录时,该文件仅存在以设置Ruby版本和gemset.您可以手动设置Ruby版本和gemset,也可以创建与RVM和其他版本管理器兼容的新.ruby-version.ruby-gemset文件.有关详细信息,请参见我的答案使用rvmrc或ruby-version文件通过RVM设置项目gemset吗?.

The file only exists to set a Ruby version and gemset when you cd into the directory. You can either set the Ruby version and gemset manually, or create new .ruby-version and .ruby-gemset files which are compatible with RVM and other version managers. For details, see my answer Use rvmrc or ruby-version file to set a project gemset with RVM?.

您可能需要删除并重新安装您正在使用的Ruby版本.方法如下:

You may need to remove and reinstall the Ruby version you are using. Here's how:

$ rvm remove ree-1.8.7-2012.02

这是文档.

您可能不需要卸载RVM.但是,如果这样做,您可以使用

You probably don't need to uninstall RVM. But if you do, you can use

$ rvm implode

在重新安装之前删除RVM的所有痕迹(在此处记录).有关使用RVM安装Ruby和多个版本的Rails的更多详细信息,请参阅我写的文章:

to remove all traces of RVM before re-installing (documented here). For more details on installing Ruby and multiple versions of Rails using RVM, see the article I wrote:

最后,由于您提到正在阅读需要旧版Rails的教程,所以我谨礼貌地建议您看看我为初学者编写的最新版本的Rails书(当前是Rails 4.1,但我在每个新发行版中都对该书进行了修订).希望对您有所帮助:

Lastly, since you mention that you are reading a tutorial that requires an old version of Rails, may I politely suggest you have a look at a book I've written for beginners that is up to date with the newest version of Rails (currently Rails 4.1 but I revise the book with every new release). I hope it is helpful:

我之所以提及我的文章和我的书,是因为它们提供了有关使用RVM为Rails设置开发环境的更多信息,并且可能会为您回答更多的问题.

I mention my article and my book because they provide additional information about setting your development environment for Rails using RVM and may answer further questions for you.

这篇关于安装RVM后Ruby on Rails Mac OSX Mavericks问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆