Showing posts with label Workshop 1. Show all posts
Showing posts with label Workshop 1. Show all posts

Wednesday, May 27, 2009

Workshop 1: Setting up Ruby on Rails

Well I decided that the Win7 environment was a little bit too progressive to try and get the Ruby environment operational. I was getting security issues with the Aptana IDE not recognising the MySQL installation. I downloaded MySQL v5.1 and tried to install that. The installation stalled when it was trying to create the initialisation file, so I was unable to set the root password or create the admin user. So I decided to start again. Last night I created a new VM and loaded XP SP3. I then loaded MySQL v5.1 and the MySQL v5 GUI tools. This time the installation went off without a hitch and I was able to create the initialization file. I installed Aptana, then installed the RADRails perspective, which loaded all the relevant gems. I created a default/ test project using SQLlite3 and this worked fine, first go. That working I attempted to create a project using MySQL as the database. Unfortunately there are still errors being thrown and it is indicating that their are missing files relating to the MySQL gem. This fails midstep. So I have decided that their is little prospect for me to be able to learn anything if I continue trying to get MySQL to work. Consequently all further work will involve me using SQLlite3 as the database backend. And thanks to Ken for giving that the ok today.

Monday, May 25, 2009

Workshop 1: Loading MySQL

I have been attempting to get MySQL installed on my VM for the past few days, have had no luck and am not going to devote anymore time to it.

I goy the Aptana IDE installed, and it seems nice enough, and relatively easy to use. I followed the demo video on Saturday and had to replay the steps a few times to see what options they selected. I got the example to work. Was unable to get anything working if I chose MySQL as the default database. I get errors stating that the machine is denying the request. I don't have a screenshot of the error message unfortunately.

Having had no luck I decided that I would attempt to install MySQL on the VM. As I said above, this has proven to be unsuccessful. As this course is not about Installing and configuring MySQL I don't believe it is worth the time to track down the cause of the issue.

This is a screenshot of the Aptana IDE showing the working test project. It may be that I am impatient, or far to used to a Windows wizard as far as installations go. I say that because the InstantRails install that I did left a lot to be desired. If you install something why do you then have to actually find the documentation that tells you how to configure it. Why wasnt that part of the installation process. I experienced this with the MySQL install as well. I only found the InstantRails config documentation tonight when I was trying to fix up the MySQL install. Well thats enough for now, back to the exercises. Until next time ...

Thursday, May 21, 2009

Workshop 1: Learning Ruby

Being used to and IDE I have downloaded Aptana and am currently loading the RADRails plugin The following link points to a video on creating a rails app in the Aptana Studio http://www.aptana.tv/movies/aptana_radrails_intro/aptana_radrails_intro.html Whilst watching the jar files being uploaded I can only hope that, not only does this run on Win7, but the security issues Craig mentioned with downloads dont raise there ugly heads.

Workshop 1: Challenge problems

1. Make a list of all programming languages and Web development tools used by you in prior experiences. Describe what you know about Web application frameworks before we begin. Computing/Programming languages The only web development that I have is that involved in meeting the requirements for the Microsoft Industry subjects webforms and distributed applications for .net 2.0 (ITI532 and ITI533). In that light the only web development tool I have used is Visual Studio 2008. 2. Ruby is “an interpreted scripting language” for quick and easy object-oriented programming”. Find out about the Ruby language and discover what this means. The code is interpreted at runtime and not compiled at design time. Ruby is interpreted scripting language:
•ability to make operating system calls directly •powerful string operations and regular expressions •immediate feedback during development
quick and easy:
•variable declarations are unnecessary •variables are not typed •syntax is simple and consistent •memory management is automatic
object oriented programming:
•everything is an object •classes, methods, inheritance, etc. •singleton methods •"mixin" functionality by module •iterators and closures
also:
•multiple precision integers •convenient exception processing •dynamic loading •threading support
3. What is Rails and how does it work with Ruby? Ruby on Rails is a powerful, open-source toolkit that enables you to build sophisticated web applications quickly. Built in Ruby (a dynamic, object-oriented language), Ruby on Rails is a framework that provides a broad set of capabilities upon which you can build your web application: It handles all the communication with the database, so you can deal with software objects and let the framework generate SQL. It provides a template system for handling layouts and page sections, plus extensive facilities for form processing and Ajax updates. There’s a wide range of plug-ins to quickly implement many features. Ruby on Rails was designed to make the best use of your time, eliminate drudgery, and let you create great solutions with an agile, iterative approach. There’s a tremendous demand for Ruby on Rails developers, so learning to build sites with Rails is a valuable step in your web development career, whether you’re building your skills as a freelancer or planning your next job move. 4. What is meant by “convention over configuration” in regards to the use of Rails in Web application development? Convention over configuration is a very important principle behind Rails. It goes hand-in-hand with another attribute of Rails, that it is “opinionated software”. The Rails design embodies lots of opinions about how you should structure your code, name your classes and files, and organize your database tables. There are methods to override most of these conventions, but if you go with the flow and follow the conventions, then you can avoid almost all configuration code. That’s convention over configuration — and the payoff is huge 5. When did Model-View-Controller begin and where is it used? History as defined by wikipedia MVC was first described in 1979[1] by Trygve Reenskaug, then working on Smalltalk at Xerox PARC. The original implementation is described in depth in the influential paper Applications Programming in Smalltalk-80: How to use Model–View–Controller.[2] There have been several derivatives of MVC; one of the most known (due to its use by Microsoft) is the Model View Presenter pattern which appeared in the early 1990s and was designed to be an evolution of MVC. However Model–View–Controller still remains very widely used. In November 2002 the W3C voted to make MVC structures part of their XForms architecture for all future web applications [3]. These specifications will now be integrated directly into the XHTML 2.0 specifications. There are now over 20 vendors that support XForms frameworks with MVC integrated into the application stack. 6. Describe the steps involved with the MVC design approach. I will get back to this later

Workshop 1: InstantRails podcasts

I have now listened to the entire series twice. It is not a bad way to pass the time on my commute. I guess I am looking forward to moving on from listening about Ruby on Rails at a conceptual level to getting my hands dirty in code and application development. A few observations first: I certainly hope that using ruby is fun, because Michael and Christopher kept telling me that using ruby was going to be "more fun" Having lived in the Visual Studio IDE for the past 5 years or so developing winforms apps, where seemingly all the tools are in one location, to be told I need to use a text editor, command line interface, subversion, etc etc etc was seemingly sounding like a step backwards. And this is going to be "more fun"? And then there is episode 8. Its all about the Mac. I chuckled to myself just a little thinking about apple - windows flame wars. Well now to get back into looking at what we need to do to get this workshop underway.

Tuesday, May 19, 2009

Workshop 1: Learning Ruby

I downloaded the Audio (Lessons 1-8) from LearningRails and also the Screencasts (Lessons 9-23). Having never used a podcast in any form before, and not one to burn music, copying these to a format I could listen to in the car on the commute to and from work turned into a challenge that wasn't.

An aside:

The iTunes player didn't work very well in burning to disk. This may have been for a number of reasons. There may be a bug in Win7 RC that caused my DVD burner to lose itself intermittently. The burner itself may have had a problem. The iTunes interface may have been my problem.

In the end I stopped using my main machine and used my laptop. This is a dell XPS1330 and also has Win7 RC installed. This showed the benefits of the homegroups concept introduced in Win7, and the ease with which network setup and connections is now handled.

Now back to the point of the blog. I finally got the podcasts (audio lessons 1-8) copied onto 3 CDs. Listened to the first 6 episodes today and found that they give a very good, yet brief overview of the Ruby language. Hopefully 7 and 8 tomorrow will give me some idea about actually getting started with Ruby development.

Sunday, May 17, 2009

Workshop 1: InstantRails success – Ruby now working

Got to have some fun with testing Win7 and creating a virtual machine. Worked fine after I had fiddled a bit with some of the settings.

Got my completely vanilla Win7 virtual machine set up about 4pm. Have run the InstantRails app and it has all worked.

Have played with the Cookbook app, sort of but am not sure what I am connected to. Have never played with a Hosts file before so am presuming that when changed to point mycookbook to 127.0.0.1 it worked, but when you run the site how do you tell?

Workshop 1: Ruby fun

I am having a wonderful time trying to get ruby to work.
I have downloaded itunes64, installed it and have proceeded to download lots of podcasts(in the learning rails series)
On unzipping the Instantrails zip file (this took longer than I expected, in the order of 5 minutes or so. Seems excessive for a 170MB expansion)and trying to run the InstantRails app was informed that my file path could not contain spaces. Painful to say the least.
Got a new path and copied all the files (only about 40000 of them)
Ran the InstantRails app and get the following error:
My machine is running Windows 7 64bit, have VS2008 professional installed with SQL2008 standard edition installed.
I guess this has something to do with SQL server??
Somewhere in all of this is the answer to my problems.
I may have to resort to creating a vanilla virtual machine with nothing installed. Unless someone has some other advice.
The documentation for installing Ruby leaves a lot to be desired.

Workshop 1: Setting up the model railway

Topic objectives

  1. Install Ruby on Rails on your computer (InstantRails or Locomotive);
  2. Learn about the Model View Controller (MVC) approach to Web application design;
  3. Revise database techniques with MySQL
  4. Learn how to use the Ruby on Rails development environment
  5. Set up a focus group (like a study group for peer learning) to work on the Ruby on Rails workshops via Interact tools

To do:

1. Download iTunes from http://www.apple.com/itunes/download/ and subscribe to the “Learning Rails” Podcasts from http://www.buildingwebapps.com/podcasts

2. Install Ruby on Rails on your computer by using the material and downloads from http://www.rubyonrails.org/

3. Rather than get Ruby on Rails running manually, you use the pre-packaged solutions. These include everything in one bundle: Web server, database, Ruby, Rails, the works.

a. For OS X, there's Locomotive.

b. For Windows, there's Instant Rails.

Recommended time: 1-4 hours.

Challenge Problems:

  1. Make a list of all programming languages and Web development tools used by you in prior experiences. Describe what you know about Web application frameworks before we begin.
  2. Ruby is “an interpreted scripting language” for quick and easy object-oriented programming”. Find out about the Ruby language and discover what this means.
  3. What is Rails and how does it work with Ruby?
  4. What is meant by “convention over configuration” in regards to the use of Rails in Web application development?
  5. When did Model-View-Controller begin and where is it used?
  6. Describe the steps involved with the MVC design approach.