• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Abbot-Setting Up

Page history last edited by Peter Wagenet 13 years, 5 months ago

Installing SproutCore 1.4

 

SproutCore 1.4 is available as a Ruby gem.  This gem is updated periodically whenever major new changes are published.  If you want the most up-to-date code, however, you should install manually instead.  See "Getting the Latest Code" below for more info.

 

To install SproutCore 1.4 just type the following into the command-line (omit sudo on Windows systems):

 

[sudo] gem install sproutcore

 

 

IMPORTANT:  SproutCore 1.0 recently transitioned from using GitHub to publish gems to using the main RubyForge repository.  If you installed SproutCore 1.0 prior to Sep 28, 2009 using gem first run the following command to uninstall the GitHub Gem:

 

sudo gem uninstall sproutit-sproutcore

 

Once you have uninstalled the old Github gem you can just use the RubyGems.org gem from now on. 

 

(If you install this gem prior to July 21 and it appears to break your RubyGem install, follow the instructions at Abbot-GemFixup to make RubyGem work again.)

 

If you are having trouble installing this way, your Rubygems may be out of date.  Follow these instructions to update RubyGems.

 

If you are installing in a virtual environment, follow the instructions on this page.

 

If you are behind a proxy server (likely in corporate environments), you need to tell gem about it.  First locate your proxy settings.  They are available somewhere in your browser's settings, and usually include a web address (e.g. http://proxy.yourcompany.com) and a port number (e.g. 80).  Then, type the following into the command-line:

 

[sudo] gem install sproutcore -p http://proxy.yourcompany.com:80/

 

Successfully calling gem will install a number of other required libraries for you.  If for some reason you are still missing required libraries, try following the instructions under "Prerequisites" below.

 

First Steps

Now that you have SproutCore 1.0 installed, here are a few commands to get you going:

 

sc-init HelloWorld

cd hello_world

sc-server

 

if you faced a problem during the last part then this probably because the PATH of the gem isn't the default one.  You can call the command as

 

/var/lib/gems/1.8/bin/sc-init HelloWorld

cd hello_world

sc-server

 

Or you may reconfigure the path  by running the following command

 

          PATH=/var/lib/gems/1.8/bin

          export PATH

 

Then rerun sc-init command. 

 

Now visit http://localhost:4020/hello_world to see your handiwork.

 

For more info checkout "Using SproutCore 1.4" below.  You can also follow the Hello World Tutorial »

 

Using SproutCore 1.4

 

Testing SproutCore with Abbot

To load your SproutCore-based app with Abbot, you simply need to invoke sc-server from Abbot.  If you installed via gem (or added the path to abbot/bin to your PATH), then you can just cd into any project directory and type:

 

sc-server

 

If you have checked-out the latest code from GitHub, cd into a project directory (like the "samples" directory you checked out above).  Then run:

 

PATH_TO_ABBOT/bin/sc-server

 

Now you can visit some of the sample apps by going to http://localhost:4020. Check out http://localhost:4020/store_configurator , http://localhost:4020/clock, and http://localhost:4020/sample_controls.  From an iPhone you can also check out the mobile demo at http://localhost:4020/iphone_demo.

 

Building SproutCore with Abbot

To perform a build of sproutcore or any other app, you can use sc-build just like before.  If you installed via gem, then just cd into any project directory and type:

 

sc-build APP_NAME -rc

 

If you checked-out the latest code from GitHub, cd into your project directory and call the build tool directly from your Abbot directory.  For example, cd into the "samples" directory you checked out above then run:

 

../abbot/bin/sc-build sample_controls -rc

 

This will do a build of the "sample_controls" app along with any required dependencies into the tmp/build directory inside your "samples" folder.

 

Running SproutCore Unit Tests

With your Abbot sc-server running, the test runner can normally be accessed at:

 

http://localhost:4020/sproutcore/tests

 

You can also run unit tests directly by visiting their URL.  This is useful if you want to automate your testing.  You can find unit tests in the source directories of each framework.  For example, the unit tests for the "sproutcore/runtime" framework are found at

 

samples/frameworks/sproutcore/frameworks/runtime/tests

 

You can load and run all of these tests by simply visiting:

 

http://localhost:4020/sproutcore/runtime/en/tests.html

 

In your web browser.  If you would like to run just the unit tests from a single file, you can change "tests.html" for a path directly to your test, changing the .js extension to .html.  For example, if you want to run the unit test in costello/tests/core/guidFor.js you would visit:

 

http://localhost:4020/sproutcore/runtime/en/tests/core/guidFor.html  <-- note '.html' not '.js'!

 

When you edit unit tests, just make your changes, save your unit test or source code, then hit refresh in the web browser.  The updated code will load and the unit tests will run again.  

 

Note that SproutCore unit testing is based on jQuery's "QUnit" library.  Although we may change this in the future, the API from this library will form the basis of future work.  Please consult this API for docs on how to write unit tests.

 

If you would like to access the unit tests for a framework other than Runtime, use the same method as described above but substitute your framework of choice for "runtime."  For example, to load the unit tests for sproutcore/foundation (found on disk at frameworks/sproutcore/frameworks/foundation), visit:

 

http://localhost:4020/sproutcore/foundation/en/tests.html 

 

Testing the Build Tools Themselves

The new build tools also sport a full set of unit tests for the build tools themselves.  These are written using rspec.  Any changes you make to the build tools must include changes to the unit tests as well.  

 

You can only run the build tools unit tests if you have checked out the latest Abbot tools from GitHub.  Gem installs do not put the unit tests in a place you can easily access them.

 

To run the unit tests, make sure you've checked out the latest Abbot version. Then cd into the "abbot" directory and type:

 

rake spec

 

You can also run an individual unit test by doing

 

spec --color path/to/unit/test

 

All unit tests can be found in the "specs" directory.  

 

In general, we create one directory for each source .rb file in the "lib" directory of Abbot.  This directory contains a single _spec.rb file for each method that contains tests for that method.  For example, to find the unit tests for the SC::Target.manifest_for() method (defined in abbot/lib/sproutcore/models/target.rb), you should look in:

 

abbot/spec/lib/models/target/manifest_for_spec.rb

 

Other Notable Changes

The Abbot build tools are primarily a rewrite of the older SproutCore build tools with the goal of making them easier to modify and adding unit tests (we went from 0 unit tests to over 400 of 'em, yay!).  However, Abbot also adds some other notable feature enhancements.  Namely:

 

  • Frameworks can now be nested.  This has allowed us to split up the "sproutcore" framework in seven smaller frameworks covering basic property observing (costello), basic application-logic (foundation), the model layer (datastore), desktop-web browser-specific UI clients (desktop), mobile-browser specific UI (mobile), testing (testing), and debugging (debug).  When SproutCore is built, it will automatically reference the proper frameworks and combine them if possible  However, you can now also build apps that reference only the frameworks you need.
  • Support for Themes.  In addition to supporting apps (or clients) and framework target types, the build tools now support "themes".  These are special targets that contain CSS, images and other assets needed to implement a particular look and feel.  SproutCore will come with two built in theme:  empty_theme (which simply resets the browser to some reasonable defaults) and standard_theme (which contains the standard SC theme.)  Other themes in private use will be converted to  themes also for 1.4.
  • Creating Multiple Resources with sc_resource().  Past versions would place all CSS into a single file called 'stylesheet.css' and all JavaScript into a single file called 'javascript.js'.  Sometimes, however, you need to build several CSS or JS files that can be loaded lazily at runtime.  Abbot now supports this.  To have a JS or CSS file included in a different combined file during a build other than the default, just add an "sc_resource('resource_name')" directive to the top of your source file.  See specs/fixtures/real_world in Abbot or some examples.

 

Getting Started with Git

SproutCore has adopted a standard workflow for using git.  To contribute to the Abbot or Bitburger tools, follow the instructions on the Git Workflow-Introduction page.  You can also get a start by visiting this page with a compilation of commonly used git commands

 

A Final Word

If you need to talk to someone about Abbot, checkout the Google Group, the IRC channel (#sproutcore on irc.freenode.net) or mail the mailing list: sproutcore@googlegroups.com.  If you need to reach someone privately about Abbot because you are working on a secret project, please email Charles Jolley.

 

Comments (20)

Juan Pinzon said

at 12:04 pm on Jan 28, 2009

Charles,

i tried this steps and i get the following


El-sarten-MBA:samples juanpin$ ../abbot/bin/sc-server
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- /Users/juanpin/code/abbot2/abbot/lib/thor/lib/thor (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/juanpin/code/abbot2/abbot/lib/sproutcore/tools.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/juanpin/code/abbot2/abbot/lib/sproutcore.rb:54:in `require_all_libs_relative_to'
from /Users/juanpin/code/abbot2/abbot/lib/sproutcore.rb:54:in `each'
from /Users/juanpin/code/abbot2/abbot/lib/sproutcore.rb:54:in `require_all_libs_relative_to'
from /Users/juanpin/code/abbot2/abbot/lib/sproutcore.rb:121
from ../abbot/bin/sc-server:3:in `require'
from ../abbot/bin/sc-server:3
El-sarten-MBA:samples juanpin$

I tried installing thor by hand but didn't succeed.

Erich Ocean said

at 2:43 pm on Jan 29, 2009

Before you can run rake spec, you need to do: sudo gem install bones

Erich Ocean said

at 2:45 pm on Jan 29, 2009

When running rake spec, I get this message maybe a hundred or more times:

WARN ~ Could not find target desktop that is required by /sproutcore

Juan Pinzon said

at 3:26 pm on Jan 29, 2009

same here

Charles Jolley said

at 5:43 pm on Jan 29, 2009

These errors were caused because of a bunch of fixture directories that were not checked in by git because they were empty. I added placeholder files to them and now things work.

Larry Siden said

at 2:32 pm on Dec 23, 2009

I'm seeing this again when I run the version of sc-server from Git, now on version 1.0.1042.

sudara said

at 6:55 am on Apr 5, 2009

I cleaned up some old leftovers and corrected a few things, hope that's ok :)

Luke Randall said

at 6:45 am on Jun 26, 2009

> Other themes in private use will be converted to themes also for 1.0.

What does this mean exactly? Does it mean that (for example) the MobileMe theme will be added as a theme and distributed with SC?

Charles Jolley said

at 10:47 pm on Jul 5, 2009

@Luke Randall: It just means that people using private themes should expect their respective teams to update those themes. No additional themes are expected for SC1.0 publicly.

Erik Eggleston said

at 7:11 pm on Jul 22, 2009

I used "sudo gem install sproutit-sproutcore" and the install went fine, but I am running into an issue when I type, "sc-init HelloWorld". I am seeing an error similar to one previously commented on, mine is:

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- /Library/Ruby/Gems/1.8/gems/sproutit-sproutcore-1.0.20090721145236/lib/thor/lib/thor (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/sproutit-sproutcore-1.0.20090721145236/lib/sproutcore/tools.rb:8
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/sproutit-sproutcore-1.0.20090721145236/lib/sproutcore.rb:58:in `require_all_libs_relative_to'
from /Library/Ruby/Gems/1.8/gems/sproutit-sproutcore-1.0.20090721145236/lib/sproutcore.rb:58:in `each'
from /Library/Ruby/Gems/1.8/gems/sproutit-sproutcore-1.0.20090721145236/lib/sproutcore.rb:58:in `require_all_libs_relative_to'
from /Library/Ruby/Gems/1.8/gems/sproutit-sproutcore-1.0.20090721145236/lib/sproutcore.rb:125
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/sproutit-sproutcore-1.0.20090721145236/bin/sc-init:9
from /usr/bin/sc-init:19:in `load'
from /usr/bin/sc-init:19

Anyone have and ideas about what I have done wrong here?

Charles Jolley said

at 11:01 pm on Jul 22, 2009

The gem system is borked as of July 22. I'm working with Github to fix it. Until then, please build from sources

Erik Eggleston said

at 8:29 pm on Jul 24, 2009

Thanks

Charles Jolley said

at 12:35 pm on Jul 25, 2009

The gem system is working again as of July 25.

Robert Allard said

at 12:55 pm on Oct 6, 2009

My Installation problem:
On the RubyForge site for Sproutcore the documentation says that Ruby 1.9 is not tested and recommends 1.8.
However I am unable to install Sproutcore 1.0.1003 from RubyForge with Ruby 1.8.
It fails to install the required dependency for fcgi and then fails to install Sproutcore.
So i am unable to test with Ruby 1.8 to see if Ruby 1.9 is the cause of my application problem.
Sproutcore 1.0.1003 from RubyForge installs without problems with Ruby 1.9.

My application problem:
The reordering functionality in the todos list does not work in my sample application.
Using Sproutcore 1.0.1003 from RubyForge and Ruby 1.9 under Windows XP Sp3 and Firefox 3.5.3.

Dokie said

at 4:41 am on Nov 2, 2009

Without a pre-requisite path to find a Java Runtime (which is not mentioned in the pre-requisites) sc-build fails, BUT, the error cannot be rported becasue of a bug in minify.rb whee in the method build_css, the variable 'output' is undefined - see build_javascript method as this seems to define it ok.

abusemind said

at 1:12 am on Feb 9, 2010

Hi!I do love Sproutcore and I am now trying to use it to develop a tiny html5 web application. I have learned sproutcore about 2 weeks, following the todo and helloworld tutorial with the backend support of persevere, they all work for me. I got one question then, maybe very stupid because of my unskilling:how can I call Java in sproutcore? I need to do sth like press a button then call some methods in Java.I find a framework called DWR which seems to be the solution, but I just cannot find the server path of sproutcore. I use sc-server to start the embeded server of sproutcore, but where is the server-structure including WEB-INF or lib which is needed to get use of DWR?

Rob Law said

at 10:34 am on Apr 22, 2010

I just tried the First Steps tutorial after installing from the gems, but I get the following error:

$ sc-server
SproutCore v1.0.1046 Development Server
Starting server at http://0.0.0.0:4020 in debug mode
To quit sc-server, press Control-C
FATAL ~ wrong number of arguments (5 for 4)

Dave said

at 2:26 pm on Apr 23, 2010

This wiki software will not take a hint about apparent weblinks that shouldn't be turned into hyperlinks.

Robert Allard said

at 7:52 am on Jul 14, 2010

Look in the Field Notes section of this wiki for specific instructions about installing Sproutcore on a Windows 7 computer. Useful for beginners.

veebs said

at 10:31 pm on Sep 13, 2010

Getting the latest abbot code using the above may give you the following error when trying to run sc-sever:

./sc-server:9:in `': undefined method `empty?' for nil:NilClass (NoMethodError)

Looking inside sc-server script, you now need to invoke sc-server from an installed gem or through bundler.

Visit http://github.com/sproutit/sproutcore-abbot/wiki/Using-Abbot-1.4-From-Source for detailed instructions.

You don't have permission to comment on this page.