ruby-on-railsrubygemsinstallationrailtie

Could not find RubyGem railties (>= 0) (Gem::LoadError) with the RailsInstaller


In Ruby on Rails, I am trying to install it on my Windows machine following the step-by-step instructions indicated in http://railsinstaller.org/windows

On step 7, it says we should type in this command:

$ rails g controller welcome index

And so I do:

PS C:\Sites\railsinstaller_demo> rails g controller welcome index

And I get this error:

C:/Program Files/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems.rb:926:in 
  `report_activate_error': Could not find RubyGem railties (>= 0) (Gem::LoadError)
  from C:/Program Files/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems.rb:244:in 
      `activate_dep'
  from C:/Program Files/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems.rb:236:in `activate'
  from C:/Program Files/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems.rb:1307:in `gem'
  from C:/RailsInstaller/Ruby1.9.3/bin/rails:18:in `<main>'

I have googled this error and read that the solution was to install de DevKit and so I did, but the problem remains.

What causes these errors?

Edit:

This is what appears when I run gem list:

PS C:\Sites\railsinstaller_demo> gem list

*** LOCAL GEMS ***

actionmailer (3.2.9)
actionpack (3.2.9)
activemodel (3.2.9)
activerecord (3.2.9)
activeresource (3.2.9)
activesupport (3.2.9)
arel (3.0.2)
builder (3.0.4)
erubis (2.7.0)
foreman (0.60.2)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
mail (2.4.4)
mime-types (1.19)
minitest (1.6.0)
multi_json (1.5.0)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
rake (0.8.7)
rdoc (2.5.8)
rest-client (1.6.7)
sequel (3.20.0)
sinatra (1.0)
sprockets (2.2.2)
taps (0.3.24)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.12)
tzinfo (0.3.35)

As suggested by @EricLeschinski I tried tu run "gem install rails" but this error appeared:

PS C:\Sites\railsinstaller_demo> gem install rails
ERROR:  Error installing rails:
    The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

Final edit:

In the end, I don't how bad I messed up my initial installation, but I found this Youtube video http://www.youtube.com/watch?v=WUdDdiu8kBs which turned out to be the clearest way to install everything that I needed and had no problem at all following her instructions.


Solution

  • Could not find RubyGem railties

    This error is due to the difference between the rails version you are using and the one defined in the Gemfile.

    Try rails -v to check the rails version.

    Reference : https://www.railstutorial.org/book/toy_app