2014-02-10

Getting started with the ng-book beginner screencast (mac)

Image source: ng-book.com
Ng-book: The Complete Book on AngularJS was featured in the HelsinkiJS January meetup. It was mentioned to be the best book on AngularJS so I went and bought the Book and source code package. This $79 package includes a 3 hour long beginner Angular screencast.

I did not find any instructions on how to get the example application server running and I don't know Ruby. So here are the steps I followed on my mac.

Getting the beginner_app server running

In the beginner_app directory run

sudo gem install bundler

  • installs the bundler package to ruby
  • To my understanding on a mac gem needs to be run as root. By default ruby has been included as part of the OS.
  • this resolved the error: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- bundler (LoadError)
bundle install --path vendor/cache
  • source
  • perhaps bundle install would have been enough in this case?
  • this resolved the error: /Library/Ruby/Gems/2.0.0/gems/bundler-1.5.2/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rack-1.5.2 in any of the sources (Bundler::GemNotFound)
Now you should be able to run bin/server without problems. 

Please leave a comment if I missed somethingor if you found this useful.

Extra spoiler: getting the list function running at 02:43:58

In 02:43:53 the author has the following line visible as part of a directive

compile: function(tElement, tAttrs, transclude) {},

After this the directive functionality is demoed. At least on my system this does not work because the empty compile function does not call the list entry. The simple solution is to remove this line from the code.

In 02:44:25 you can notice that the compile entry is gone. I must admit though that it was fun to find this out by myself :)

3 comments:

Anonymous said...

thanks so much. i had no idea where to begin with this. This solved my problems with getting the server started.

John Simoneau said...

You're my hero, thanks for sharing this info! Work/ like a charm! I was a little annoyed that they were just like, "okay, run this simple command." Many thanks!

Anonymous said...

Thanks!