First of all SproutCore is, from their website:
SproutCore is an HTML5 application framework for building responsive, desktop caliber applications in any modern browser, without having to rely on plugins.
I recently decided to look into SproutCore and decided that the documentation for installation was lacking for an installation from the ground up, especially on Windows. There is a how to for installing SproutCore (available here: http://wiki.sproutcore.com/w/page/12412840/Abbot-Setting%20Up) but it lacks some important details about installing Ruby and RubyGems so I thought I would add those steps. So the rough outline is to first install Ruby on Rails, then install Ruby Gems, then install SproutCore. I ran into several problems with Ruby because I was installing on Windows XP. Ruby expects a user to have a "sane" environment which according to the DevKit page includes "make, gcc, sh and similar *nix build tools installed".

Ruby on Rails

The first thing you will need to do is install Ruby on Rails. I am working on Windows XP at the moment so I downloaded the Ruby Windows installer from http://rubyforge.org/frs/?group_id=167. The installation is simple, just run the executable and choose a path for Ruby. Luis Lavena (http://blog.mmediasys.com/) pointed out that having a space in your path can cause problems (https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#gems_fails). This applies to Ruby Gems installation directory as well. I added Ruby to my path and associated with Ruby file extensions.

Ruby Gems

The second thing that you need to do is install Ruby Gems. Ruby Gems is a package management system for Ruby. You can download Ruby Gems fromhttps://rubygems.org/pages/download. To install Ruby Gems you will need to unzip the download into a directory and navigate to that directory. It is important that you not have any spaces in your install directory. Then it is simply a "ruby setup.rb" to install Ruby Gems.


Now you can follow the documentation at the SproutCore how to. Basically you just "gem install sproutcore". But if you are working on Windows then you will probably run into this when you install SproutCore:
>gem install sproutcore Fetching: rack-1.2.2.gem (100%) Fetching: json_pure-1.4.6.gem (100%) Fetching: extlib-0.9.15.gem (100%) Fetching: abstract-1.0.0.gem (100%) Fetching: erubis-2.6.6.gem (100%) Fetching: thor-0.14.6.gem (100%) Fetching: eventmachine-0.12.10.gem (100%) ERROR: Error installing sproutcore: The 'eventmachine' 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'
You can find out more about DevKit athttps://github.com/oneclick/rubyinstaller/wiki/Development-Kit and you can download DevKit athttp://rubyinstaller.org/downloads, which you probably picked up on from the error message above. Now you may think that by installing this that all is good in the world and your install will proceed without further problems. They didn't for me. I got this error message:
>gem install eventmachine Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing eventmachine: ERROR: Failed to build gem native extension. "C:/Program Files/Ruby192/bin/ruby.exe" extconf.rb checking for rb_trap_immediate in ruby.h,rubysig.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Program Files/Ruby192/bin/ruby C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError) You have to install development tools first. from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:446:in `try_compile' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:568:in `try_var' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:816:in `block in have_var' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' from C:/Program Files/Ruby192/lib/ruby/1.9.1/mkmf.rb:815:in `have_var' from extconf.rb:16:in `<main>' Gem files will remain installed in C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/ gems/eventmachine-0.12.10 for inspection. Results logged to C:/Program Files/Ruby192/lib/ruby/gems/1.9.1/gems/eventmachine -0.12.10/ext/gem_make.out
After a bit of research I found that the latest version of "eventmachine" is not compatible with DevKit. You have to get the pre-release version by using this command:
gem install eventmachine --pre
You should see something like this if you did everything correctly:
>gem install eventmachine --pre Fetching: eventmachine-1.0.0.beta.3-x86-mingw32.gem (100%) Successfully installed eventmachine-1.0.0.beta.3-x86-mingw32 1 gem installed Installing ri documentation for eventmachine-1.0.0.beta.3-x86-mingw32... Installing RDoc documentation for eventmachine-1.0.0.beta.3-x86-mingw32...
When you try and install SproutCore again you should see a successful install like this:
>gem install sproutcore Fetching: daemons-1.1.2.gem (100%) Fetching: thin-1.2.11-x86-mingw32.gem (100%) Fetching: sproutcore-1.4.5.gem (100%) Successfully installed daemons-1.1.2 Successfully installed thin-1.2.11-x86-mingw32 Successfully installed sproutcore-1.4.5 3 gems installed Installing ri documentation for daemons-1.1.2... Installing ri documentation for thin-1.2.11-x86-mingw32... Installing ri documentation for sproutcore-1.4.5... Installing RDoc documentation for daemons-1.1.2... Installing RDoc documentation for thin-1.2.11-x86-mingw32... Installing RDoc documentation for sproutcore-1.4.5...
Now if you are as fortunate as I was, you will run into one more problem in your installation. When you run "sc-init HelloWorld" you will get an error like this:
>sc-init HelloWorld ~ Created directory at hello_world FATAL ~ invalid byte sequence in US-ASCII
This is because Ruby defaults to "C" for the LANG environment variable. I changed the value of LANG to "en_US.UTF-8" and then everything worked fine. A correct installation looks like this for reference:
C:\Ruby\SproutCore>sc-init HelloWorld ~ Created directory at hello_world ~ Created file at hello_world/Buildfile ~ Created file at hello_world/README ~ Created directory at apps ~ Created directory at apps/hello_world ~ Created file at apps/hello_world/core.js ~ Created file at apps/hello_world/main.js ~ Created directory at apps/hello_world/resources ~ Created file at apps/hello_world/resources/loading.rhtml ~ Created file at apps/hello_world/resources/main_page.js Your new SproutCore project is ready! To get started, you can find your initial application in the "apps" directory.
I installed version 1.9.2-p180 of Ruby (rubyinstaller-1.9.2-p180.exe), Ruby Gems version 1.6.2 (rubygems-1.6.2.zip), and DevKit version 4.5.1 (DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe).

Loading Conversation