Ruby on Rails Mac OSX Mavericks issues after RVM install

孤街浪徒 提交于 2020-01-03 17:04:27

问题


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

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!

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? If so, how can it be achieved?


回答1:


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

$ rm .rvmrc

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?.

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

$ rvm remove ree-1.8.7-2012.02

Here's the documentation.

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

$ rvm implode

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:

  • Install Ruby on Rails - Mac OS X

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:

  • Learn Ruby on 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.



来源:https://stackoverflow.com/questions/23599904/ruby-on-rails-mac-osx-mavericks-issues-after-rvm-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!