Friday, April 17, 2009

My tutorial at RailsConf 2009

I'm teaching a three-hour tutorial at RailsConf 2009 on SproutCore and Rails, called "Building Next Generation Web Apps with Rails and SproutCore".  Since three hours isn't a whole lot of time, I wanted to post some things that students can do to prepare to get the most out of the training.

See you in Las Vegas!

Prerequisites

We'll use the stable release of SproutCore (0.9.23) although I plan to address what's different about the 1.0 API which is currently in alpha testing.  So to be able to work in the tutorial, you'll need recent versions of Ruby and RubyGems.  Follow these directions to install SproutCore.

Note that the SproutCore gem depends on merb-core (>= 0.9.9), erubis, rubigen, and mongrel.

Before the tutorial starts, you must be able to view localhost:4020.  If that works, you know everything installed correctly.

This may go without saying, but you also need to have Rails 2.3.x installed.  Specifically you should be able to load the Rails startup page on your development machine at http://localhost:3000/.

Recommended Reading

I strongly recommend you complete the "Hello World" tutorial on the SproutCore home page. You may also want to browse the project wiki to get more of a sense of the framework.

The most helpful wiki articles to read include:

10 comments:

Paul Barry said...

Wish I could be there. Good luck!

Aaron Reichman said...

FYI, I couldn't get the SproutCore server to start up on Leopard due to an extlib compatibility issue. Downgrading that gem, per the thread below worked for me.

SproutCore server startup error

Mike Subelsky said...

thanks for tracking that down, hope it doesn't bother anyone else. See you soon!

ghfeil said...

I was successful with installing sproutcore, but am unable to get "hello world" to run. Here's the stack trace:

/Library/Ruby/Gems/1.8/gems/extlib-0.9.11/lib/extlib/time.rb:26:in `remove_method': method `to_time' not defined in Time (NameError)
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.11/lib/extlib/time.rb:26
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/george/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from /Users/george/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/george/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.11/lib/extlib.rb:22
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
... 9 levels...
from /Users/george/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from /Library/Ruby/Gems/1.8/gems/sproutcore-0.9.23/bin/sc-server:13
from /usr/bin/sc-server:19:in `load'
from /usr/bin/sc-server:19

I have rails 2.3.2 installed as well. This occurred on OSX 10.5.6 using Ruby 1.8.6p114.

George said...

Oops, I just saw Aaron's comment about the extlib incompatibility just now.

bcarreno said...

I get the following error trying to install SproutCore. I'd say it's a compatibility issue with Ruby 1.9. The problem is I installed my Ruby 1.9 by compiling the sources and I can't uninstall it now (there's no "make uninstall"). Any ideas?

yoda:~ bcarreno$ sudo gem install sproutcore
Building native extensions. This could take a while...
ERROR: Error installing sproutcore:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for main() in -lc... yes
creating Makefile

make
gcc -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.2 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common -o http11.o -c http11.c
http11.c: In function ‘http_field’:
http11.c:77: error: ‘struct RString’ has no member named ‘ptr’
http11.c:77: error: ‘struct RString’ has no member named ‘len’
http11.c:77: warning: left-hand operand of comma expression has no effect
http11.c:77: warning: statement with no effect
http11.c: In function ‘header_done’:
http11.c:172: error: ‘struct RString’ has no member named ‘ptr’
http11.c:174: error: ‘struct RString’ has no member named ‘ptr’
http11.c:176: error: ‘struct RString’ has no member named ‘ptr’
http11.c:177: error: ‘struct RString’ has no member named ‘len’
http11.c: In function ‘HttpParser_execute’:
http11.c:298: error: ‘struct RString’ has no member named ‘ptr’
http11.c:299: error: ‘struct RString’ has no member named ‘len’
make: *** [http11.o] Error 1

bcarreno said...

Yes, I downgraded to Ruby 1.8.7 and the SproutCore installation worked.

In case it's useful, although everyone is different, this is how I uninstalled Ruby 1.9:

cd /usr/local
sudo rm -Rf lib/ruby
sudo rm -Rf include/ruby-1.9.1/
sudo rm -Rf lib/libruby*
sudo rm -Rf bin/ruby
rm -Rf src/ruby-1.9.1-p0
rm -Rf src/ruby-1.9.1-p0.tar.gz

Then I re-installed Ruby, RubyGems and Rails.

sudokohey said...

where is today's slide?

bourne111 said...

MBT shoes|MBT shoes
supra shoes|supra shoes
Nike shoes|nike shoes
adidas sneakers|adidas sneakers
adidas outlet|adidas outlet
Nike outlet|nike outlet
Nike sneakers|nike sneakers

basketball shoes,nike basketball shoes
Nike Outlet,adidas outlet
nike shoes|nike shoes
adidas shoes|adidas shoes
basketball shoes|basketball shoes
NBA basketball shoes|NBA basketball shoes
Nike Basketball shoes|Nike Basketball shoes
adidas basketball shoes|adidas basketball shoes

LeBron James Shoes|LeBron James Shoes
Kobe Bryant Shoes|Kobe Bryant Shoes
LeBron James Shoes|LeBron James Shoes
Kobe Bryant Shoes|Kobe Bryant Shoes

nike shoes,adidas shoes,nike outlet,adidas outlet,basketball shoes,nike basketball shoes,adidas basketball shoes,nba basketball shoes

Mathew J. said...

generic viagra
buy viagra
viagra online