简体   繁体   English

Ruby on Rails Mac OSX Mavericks在安装RVM后出现问题

[英]Ruby on Rails Mac OSX Mavericks issues after RVM install

I have been learning Ruby on Rails for a couple of months, and everything was working. 我已经学习了Ruby on 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. 然后,为了满足教程的需要,我尝试安装RVM,以便将我的设置降级到旧版本的Ruby和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!

Two questions: 两个问题:

  1. How can I resolve the errors appearing in my Terminal? 如何解决终端中出现的错误? (see above) (往上看)

  2. 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? 因为我不知道我的安装中出了什么问题,所以我想知道是否应该取消整个Ruby on Rails环境,并再次设置它以获得干净安装:这是一个好主意吗? If so, how can it be achieved? 如果是这样,怎么能实现呢?

Your first set of errors will go away if your remove the hidden .rvmrc file in your project directory: 如果删除项目目录中隐藏的.rvmrc文件,则第一组错误将消失:

$ rm .rvmrc

The file only exists to set a Ruby version and gemset when you cd into the directory. 该文件只存在于设置一个Ruby版本和宝石你当cd进入目录。 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. 您可以手动设置Ruby版本和gemset,也可以创建与RVM和其他版本管理器兼容的新.ruby-version.ruby-gemset文件。 For details, see my answer Use rvmrc or ruby-version file to set a project gemset with RVM? 有关详细信息,请参阅我的答案使用rvmrc或ruby-version文件使用RVM设置项目gemset? .

You may need to remove and reinstall the Ruby version you are using. 您可能需要删除并重新安装正在使用的Ruby版本。 Here's how: 这是如何做:

$ rvm remove ree-1.8.7-2012.02

Here's the documentation . 这是文档

You probably don't need to uninstall RVM. 您可能不需要卸载RVM。 But if you do, you can use 但如果你这样做,你可以使用

$ rvm implode

to remove all traces of RVM before re-installing ( documented here ). 在重新安装之前删除所有RVM痕迹( 此处记录 )。 For more details on installing Ruby and multiple versions of Rails using RVM, see the article I wrote: 有关使用RVM安装Ruby和多个版本的Rails的更多详细信息,请参阅我写的文章:

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). 最后,既然你提到你正在阅读一本需要旧版本Rails的教程,我可以礼貌地建议你看看我为初学者编写的一本书,它是最新版本的Rails(目前是Rails) 4.1但我在每个新版本中修改了这本书。 I hope it is helpful: 我希望它有用:

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为Rails设置开发环境的其他信息,并可能为您回答更多问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM