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

Crazy errors at the "rails new testapp" stage when installing Ruby

Having a lot of issues trying to install Ruby/Rails. At the point where I'm typing "rails new testapp" into the Windows command line prompt and I got the following error:

C:\Users\penningtonc\Documents>rails new testapp
DL is deprecated, please use Fiddle
      create
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/views/layouts/application.html.erb
      create  app/assets/images/.keep
      create  app/mailers/.keep
      create  app/models/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/bundle
      create  bin/rails
      create  bin/rake
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/secrets.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/robots.txt
      create  test/fixtures
      create  test/fixtures/.keep
      create  test/controllers
      create  test/controllers/.keep
      create  test/mailers
      create  test/mailers/.keep
      create  test/models
      create  test/models/.keep
      create  test/helpers
      create  test/helpers/.keep
      create  test/integration
      create  test/integration/.keep
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.keep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.keep
         run  bundle install
DL is deprecated, please use Fiddle
C:\Ruby200-x64\devkit\bin\sh.exe: *** Couldn't reserve space for cygwin's heap (
0x60E90000 <0x22A0000>) in child, Win32 error 0
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Installing rake 10.3.2
Using i18n 0.6.11

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
creating Makefile

make "DESTDIR="
generating generator-x64-mingw32.def
m.AllocationBase 0x0, m.BaseAddress 0x60E90000, m.RegionSize 0x170000, m.State 0
x10000
C:\Ruby200-x64\devkit\bin\sh.exe: *** Couldn't reserve space for cygwin's heap (
0x60E90000 <0x22A0000>) in child, Win32 error 0
make: *** [generator-x64-mingw32.def] Error 1


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/json-
1.8.1 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/json-1.8.1/ext/json/ex
t/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

I then tried again and it's now expecting a response from me:

C:\Users\penningtonc\Documents>rails new testapp
DL is deprecated, please use Fiddle
       exist
   identical  README.rdoc
   identical  Rakefile
   identical  config.ru
   identical  .gitignore
   identical  Gemfile
       exist  app
   identical  app/assets/javascripts/application.js
   identical  app/assets/stylesheets/application.css
   identical  app/controllers/application_controller.rb
   identical  app/helpers/application_helper.rb
   identical  app/views/layouts/application.html.erb
   identical  app/assets/images/.keep
   identical  app/mailers/.keep
   identical  app/models/.keep
   identical  app/controllers/concerns/.keep
   identical  app/models/concerns/.keep
       exist  bin
   identical  bin/bundle
   identical  bin/rails
   identical  bin/rake
       exist  config
   identical  config/routes.rb
   identical  config/application.rb
   identical  config/environment.rb
    conflict  config/secrets.yml
</config/secrets.yml? (enter "h" for help) [Ynaqdh]

Don't have a clue how to fix this :(

3 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Uninstall the 64-bit version and install 32-bit version. 64-bit version is faulty. If that doesn't help, you can set up an online environment: https://c9.io/ (you can select the Rails environment or even railstutorial.org environment, which will also have git pre-installed). Here's a tutorial: https://www.railstutorial.org/book/beginning#sec-up_and_running

Developing Rails under Windows will regularly give you a hard time.

Thank you, I will give it a try! My boss used the rails installer (http://railsinstaller.org/en) and said it was a breeze! But I'm trying to do it the Treehouse way so I don't miss out on anything that's required.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Yeah, you could try the installer and then install newer version of Rails. It has everything you'd need for Treehouse courses, including Git. All the gems can be installed at any point when you need them. But I will always advise against Windows - I used it for a few months and in the end I installed Ubuntu on VMWare Player. Now I'm testing Cloud9 and it seems very promising.

Well, I've tried 3 versions of Ruby and the Ruby Installer. The Ruby Installer was great, wish I'd used it to begin with! However, I still am receiving errors when running the command "rails new testapp". Keeps talking about "Couldn't reserve space for cygwin's heap" and "An error occurred while installing json (1.8.1), and Bundler cannot continue. Make sure that gem install json -v '1.8.1' succeeds before bundling."

I've been Googling all afternoon and tried every solution the folks over on Stack Overload have suggested but to no avail.

I spoke to my boss and he agreed with you about Windows being shonky for this and we should try a vm.

Thanks for all your help!