profile

Categories

Tags

Welcome!

You'll find my course content and collaborative discussion about technology.

I teach as an adjunct faculty in the Computer Information Systems department at Spokane Community College

Email

kblake DOT scc AT gmail DOT com

Presentations/Interviews

RubyLearning.com interview
Course Technology - Ruby on Rails Presentation



Starting a Rails App

April 11th, 2008 |

Concepts
Download Rails App
  1. Download
  2. Unzip
  3. Navigate into folder and run rake db:migrate
  4. ruby script/server

14 Responses to “Starting a Rails App”

  1. Jeffrey Wheeler Says:
    Hey Karmen, All this is so COOL!!!! I get it man! I have one request, when you record could you change the resolution so that when you are working in the console it is more readable. The text is to small when viewed in the higher resolutions making it hard to catch the commands you are using. That would be so AWWWWESOME!!! Thanks, J
  2. Karmen Says:
    Thanks. I also just noticed my transparency on my console background does not help for readability too. For next time, I'll enlarge font size and make my console background solid black.
  3. Sara Says:
    Karmen, great screen cast! I tried to unzip your rails app and had all kinds of problems. Inside each of the folders in the app there is the folder (that contains the stuff it should) and a "file" that is 0 kb with the same name. When I unzip, I only get the 0kb files. So, I went through and manually (folder by folder) copy and past the folders and files needed. Then I got the following error when I tried to run the ruby db:migrate command "rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/rake.rb:1849:in 'load_rakefile' (See full trace by running task with --trace)" I have no idea what that all means. I did verify that I have the rake-0.7.2 gem installed. I am running Vista and don't know if that is causing the problem.
  4. Karmen Says:
    To all, can someone else report experience with zip file. If someone gets a good copy, can they put on a network drive at school. Thanks.
  5. Angie Says:
    I'm bringing it in for Sara. I could ask Lynn or Dave to put it on p drive.
  6. Karmen Says:
    Angie, thanks! I appreciate the help.
  7. Sara Says:
    Thank you Angie. I ran a test today. I downloaded the zip file onto my H drive at SCC and was able to sucessfully unzip the file. So... looks like Vista is not very "unzip" friendly :(
  8. Angie Says:
    The unzipped folder is now on p drive, in Karmen's' folder, CIS 284, Spring 2008.
  9. Jeffrey Wheeler Says:
    Karmen, Adam showed me a cool way to view the screen casts so they almost fill the screen yet you don't have to go full screen....I can read the code know as you type it to the console.... COOL! Thanks Adam! (Click Menu, then click embedded and copy the URL from the pop up to the address bar in another tab in your browser,(hit enter and wait for it to load)). Works Slick! Jeff
  10. Karmen Says:
    Jeff, I posted last quarter (http://webdev.scc.spokane.edu:3000/2008/2/19/comparable-lecture#comment-162) about viewing the videos in full screen. Oh gosh, I'm sorry to those trying to view videos not in full screen. Ouch, there's no way when condensed. So, Everyone, please watch videos in full screen. Whew. I hope people see this. There is an easy way to switch to full screen mode: in the upper-right hand corner of the video there is a 4-way arrows icon that can be clicked on. :)
  11. Warren Lewis Says:
    I imagine I just forgot something from previous terms but I can't understand the migrate script: create_table :stories do |t| t.string :url t.string :title t.string :description t.timestamps end the "do" is going to iterate through something, isn't it? Assigning each instance to t? But why would we go through this more than once? And what is t? Will we go through it once only, with t being set to "stories"? If so, what is stories?
  12. Karmen Says:
    Warren, awwwhh, see that is why I wish I would have squeezed in an assignment on the Procs and Blocks that I covered at the of last quarter. The do |t| ... end is a block (anonymous function) that uses 't' an anonymous variable to do some work. It is not necessarily iterational. We are used to seeing blocks in iterative fashion (each, times, etc.). Blocks can be used for anything, such as migrations. It might help to review the Procs and Blocks information.
  13. Warren Lewis Says:
    Thanks for the hint. I found the section on procs in the 'Ruby for Rails' book. Interesting but not helpful. When I look at the migrate script I see no proc.new, no x.call. Can you talk me through what that thing is doing? What is 't'?
  14. Karmen Says:
    Warren, so the proc.new and x.call is the stuff that happens when you define the method with a block. What we benefit from is just calling the block. The rails gurus did their metaprogramming tricks with the use of blocks to give us nice and easy to use syntax for creating and modifying database tables. 't' is an anonymous variable to be used temporarily for any local object to be referenced and used. This website is kind of a fun/silly way to learn about how blocks are used: http://blog.codahale.com/2005/11/24/a-ruby-howto-writing-a-method-that-uses-code-blocks/

Sorry, comments are closed for this article.