Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Installing a Ruby Development Environment Installing a Ruby Development Environment Installing Ruby on Windows

Installing Ruby on Windows - the last command "bundle exec rails server" gave an error and localhost doesn't work

I followed the instructions but localhost doesn't seem to be working. Here are brief details from command prompt:

C:\Users\Andrew Luu\Documents\testapp>bundle exec rails server DL is deprecated, please use Fiddle => Booting WEBrick => Rails 4.1.4 application starting in development on http://0.0.0.0:3000 => Run rails server -h for more startup options => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0 .0.1 (--binding option) => Ctrl-C to shutdown server Exiting C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-.2.2/lib/tzinfo/data_source.rb:1 82:in `rescue in create_default_data_source': No source of timezone data could be found. (TZInfo::DataSourceNotFound) Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving th is error.

I've visited the link https://github.com/tzinfo/tzinfo/wiki/Resolving-TZInfo::DataSourceNotFound-Errors as it suggested and still am unsure how to add the time zone. Which program would I use to access and edit my gem file?

Any ideas on how to resolve this problem?

Thanks!

2 Answers

Have you tried the fix suggested at the link included in the error message?

"The simplest way to resolve this error is to install the tzinfo-data gem, either by editing your Gemfile or by running gem install tzinfo-data."

1) What OS are you using. 2) Please quote your Gemfile

Yes, I've tried doing "install tzinfo-data" in cmd.exe and it says "1 gem installed". But I still can't access localhost. How do I access my gemfile and with which program would I use to edit it?

'Gemfile' should be located in the root of your application directory. You can edit it with any text editor.

Try running "rails server" from your application directory now that the gem is installed.

I'm using Windows 7, x64. I'm not sure what "quote your Gemfile" means. I'm afraid I'm a totally newbie and will need some handholding here (but hopefully not for long!).

When you say "gemfile" in root of application directory, can you point out what that file address might look like? Right now, my Ruby folder is at C:\Ruby200-x64 and inside I have "bin", "devkit", "doc", "include", "lib", and "share" folders.

When you say run "rails server" from application directory, can I just do that by opening a fresh cmd.exe window and typing in "run rails server"?

Thank you!

Sorry about that Andrew, I was thinking a couple steps ahead to where you scaffold your first app. Just try running "bundle exec rails server" again now that the gem is installed.

When you build your first application, you'll get familiar with the Gemfile. Of course your application doesn't have a directory yet because it doesn't exist! (Sorry! :D)

No worries, Chris. Yes I just tried running "bundle exec rails server" again and it gave me the same error.

Take a look at 'C:\Users\Andrew Luu\Documents\testapp\Gemfile' with any text editor.

Is there a line in there that says gem 'tzinfo-data', platforms: [:mingw, :mswin]?

If so, change it to say:

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

Ok, I just changed it as you suggested and followed this: "After editing your Gemfile, run bundle update at the command line to install the tzinfo-data gem. You'll then be able to start your project." and then ran "bundle exec rails server" and localhost:3000 worked momentarily. It seems as though when I close cmd prompt, localhost:3000 stops working. Let me go through the rest of the tutorial series and see if those steps resolve that issue.

Thank you for the help! I'm still learning to crawl so I'm sure I'll be back while learning to walk.

No problem Andrew. When you want the application running, you'll need to leave the rails server running. Just open up another command prompt window to do whatever else you need to do.

Glad I could help!