Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Ruby on Rails localhost:3000 not working?

I'm installing ruby on rails in Windows. I have tried localhost:3000, 127.0.0.1:3000 and 0.0.0.0:3000 in Chrome, but none is working. I ran the following commands "gem install bundle sqlite rails", "rails new testapp", "cd testapp" and "bundle exec rails server". I even restart my machine, but no luck.

5 Answers

The problem is fixed. The real problem was not connecting to localhost:3000, but was that rails wasn't installed correctly. When I ran "rails server" there was an error line that said: C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.2.1/lib/tzinfo/data_source.rb: No source of timezone data could be found. Please refer to http://tzinfo.github.io/datasourcenot found for help resolving this error. The link to the solution is: https://github.com/tzinfo/tzinfo/wiki/Resolving-TZInfo%3a%3aDataSourceNotFound-Errors I think this is a common error in Windows machine. After I changed the gemfile, rails is up and running. Thanks everyone for your help and sorry for not finding the real problem.

Kevin Lozandier
Kevin Lozandier
Courses Plus Student 53,747 Points

A longtime Rubyist on Windows, I highly recommend not using the 64-bit version of Rails and Ruby on Windows.

I had exactly the same problem. Thanks for posting the solution.

Yes, I have.

Joshua Briley
Joshua Briley
Courses Plus Student 24,645 Points

Which version of Ruby are you using? Is it consistent with your gem file?

Joshua Briley
Joshua Briley
Courses Plus Student 24,645 Points

Assuming you have RVM installed, can you type rvm list into your terminal and tell me what you see?

The version is ruby-2.0.0-p481-x64. Using the command gem query --local, the gem files installed are: bundler 1.6.2, rails 4.1.1, sqlite3 1.3.9x64

How do I run rails server on the localhost:3000?

Chase Lee
Chase Lee
29,275 Points

Type rails server into the console while in you project directory. Then while it's running type localhost:3000 into your web browser.

Yeap, I tried that and it didn't work.

Artem Prytkov
Artem Prytkov
11,932 Points

1) Test if you have actually installed rails via rails -v 2) Make sure you changed directory (in command prompt) to one, where your current project is. 3) Run rails s command

Julian Betancourt
Julian Betancourt
11,466 Points

I kind of have the same problem, I installed ruby using railsinstaller.org version 2.1 on Windows, now when i type rails s I get some information but I can't see the localhost address. This is what I get: http://oi61.tinypic.com/1z4j39v.jpg

Hope you can help me out