Ruby on Rails, Could Not Find a Valid Gem 'Rails'

Error: Could not find a valid gem installing rails on mac

You can follow as steps below:

  1. gem sources -a http://rubygems.org
  2. gem install rails -v 5.0.0.1

ERROR: Could not find a valid gem 'rails' (= 0) in any repository

Use rvm gem install rails

I just did it and it worked for me.

If you don't have rvm, then:

  1. If you don't have ruby:

Install RVM and ruby:

$ curl -L https://get.rvm.io | bash -s stable --ruby

or

Additionally with rails:
$ curl -L https://get.rvm.io | bash -s stable --rails

could not find a valid gem 'ruby'

Ruby is not a gem. Ruby is the programming language.

What the error is telling you is that the version of Ruby that you have on your machine (try running ruby --version) is below that which the application you are trying to install requires.

I'm not familiar with Metasploit in particular, but your options seem to be:

  1. to try upgrading what you have installed (apt-get update && apt-get upgrade),

  2. if you are on the latest version of Ruby available in the repositories, to try using a Ruby version manager (my preference is rbenv, but each has its advantages), or

  3. to compile Ruby from source.



Related Topics



Leave a reply



Submit