Errors when trying to set up Ruby on Rails and connect to localhost:3000-Collection of common programming errors

I apologize ahead of time if I don’t do a good job of explaining this. I am a complete beginner and I have been struggling to find anything online that is written with that in mind.

So far, my only experience is doing the Javascript and Ruby sections of Codecademy.com. I read that I should have some knowledge of Ruby before trying out Rails.

So I found this site Getting Started with Rails and I tried to follow the steps and do exactly as it said. It even says at the beginning, “This guide is designed for beginners who want to get started with a Rails application from scratch. It does not assume that you have any prior experience with Rails.” It also says, “The best way to use this guide is to follow each step as it happens, no code or step needed to make this example application has been left out, so you can literally follow along step by step.”

Anyway, I’m using Windows 7 Home Premium and I already had Ruby installed. When I go into the command prompt and type ruby -v it says ruby 1.9.3p484 (2013-11-22) [i386-mingw32]. When I type rails -v it says 4.0.2. When I type gem -v I get 1.8.28. Now in the instructions it links to a place to download RubyGems and it says that it’s 2.2.2. I downloaded that and clicked the setup.rb file and it said it installed it, yet the version is still 1.8.28. I don’t know why, but it says it’s installed so I assumed it did what it was supposed to do. I’m probably wrong.

Then I’m supposed to type rails server and then go to localhost:3000 and see some kind of default page. However, when I type rails server I get these errors. Sorry for the copy and paste, but I’m not allowed to post a pic of the command prompt.

E:\Apps\RailsWork\blog>rails server
?[31mCould not find gem 'rails (= 4.0.2) x86-mingw32' in the gems available on t
his machine.?[0m
?[33mRun `bundle install` to install missing gems.?[0m

E:\Apps\RailsWork\blog>bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.9.0)
Installing atomic (1.1.16)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

    "E:/Apps/Rails Installer Package/RailsInstaller/Ruby1.9.3/bin/ruby.exe"

extconf.rb
E:/Apps/Rails Installer Package/RailsInstaller/Ruby1.9.3/bin/ruby.exe: invalid o
ption -P  (-h will show valid options) (RuntimeError)


Gem files will remain installed in E:/Apps/Rails Installer Package/RailsInstalle
r/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/atomic-1.1.16 for inspection.
Results logged to E:/Apps/Rails Installer Package/RailsInstaller/Ruby1.9.3/lib/r
uby/gems/1.9.1/gems/atomic-1.1.16/ext/gem_make.out
An error occurred while installing atomic (1.1.16), and Bundler cannot continue.

Make sure that `gem install atomic -v '1.1.16'` succeeds before bundling.

E:\Apps\RailsWork\blog>

You can see that it tells me to type bundle install, but when I try that I get another few error messages. I’ve tried googling these error messages, and some of them even linked me to questions asked on this site, but most of them were close, but not exactly what I’m having trouble with, and all of them have answers that are away over my head.

I also thought maybe it didn’t matter and so I tried to go to localhost:3000 anyway, but I get the “Oops! Google Chrome could not connect to localhost:3000” message.

I’m a total noob. Everything I look up just gets me more confused so I’m hoping the answer is kind of simple and that someone can point it out for me in a beginner-friendly kind of way. I feel like once I get over this hump of getting all of this set up, I can actually start learning and gaining some experience. I had a blast learning Ruby so far and I hope to continue on with learning Rails. Thanks for reading and any help would be greatly appreciated. Oh, and if anyone has any better suggestions for a beginner’s guide to all of this stuff, I’d also really appreciate it. Thanks again.