Troubles with ruby-2.X installation using RVM

拜拜、爱过 提交于 2019-11-30 19:34:07

Try the following

$ rvm remove 2.0.0 # get rid of unsuccessful installation
$ rvm get head --autolibs=3 # get the latest RVM and build required libs
$ rvm requirements # just in case, install all other required stuff
$ rvm install ruby-2.0.0

If at any of those commands fails at any point. Update your question with the logs.

I had this exact same problem. The solution was elegant and simple.

Just update your gems direct from the command line:

sudo gem update --system

That's it! Terminal will now show:

Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-2.0.3
Updating RubyGems to 2.0.3
Installing RubyGems 2.0.3
RubyGems 2.0.3 installed

I had this exact same problem, same error message, etc. I don't know about you, but I use MacPorts, and through that I have libraries like OpenSSL installed, which I think may have contributed to my trouble.

I just got it working on my system; I'm not sure exactly what I did right but here are the steps I took:

  1. Set up my ~/.rvmrc to match the first code block here.
  2. Uninstalled 2.0.0 through rvm (rvm remove 2.0.0).
  3. Removed the folders for ruby-2.0.0, rubygems-2.0.0 and the dependency packages like OpenSSL and YAML in ~/.rvm/src.
  4. Executed rvm install 2.0.0 --with-opt-dir=/opt/local --autolibs=0. /opt/local is my MacPorts prefix directory, and autolibs=0 disables any dependency installation so it didn't have the opportunity to use something other than my MacPorts libraries. If you get through this step without red console output you're past the errors you were having above.
  5. Not knowing if having an empty default gemset was the problem I also ran rvm use --create 2.0.0@... to get a non-default gemset created and then (successfully) installed a gem and its dependencies into it.

I hope this helps!

Open Up the Terminal and then Go to Edit > Profile Preferences and then go to the Tab "Title and Command" and Check "Run Command as Login Shell".

Boot Up a Bash and Now you can install Gems directly from the terminal without the use of sudo and the error "RVM is not a function, selecting rubies with 'rvm use ...' will not work." will be eliminated.

Cheers.

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