In 2008, over one thousand people experienced the world’s first virtual web conference. Together, we created a new type of conference that is environmentally-friendly, affordable, and interactive.

In 2009, we are going to take it one step further.


Creating applications with RoR on OS X

You've no doubt heard about Ruby on Rails (RoR) by now. It's a full-stack Model-View-Controller (MVC) framework for creating web applications using the Ruby programming language. RoR adheres to the Don't Repeat Yourself (DRY) principle and uses the dynamic nature of Ruby and the idea of convention over configuration to reduce duplication and code line-count without sacrificing maintainability or scalability. In short, it's a Good Thing! Even better news: If you're on OS X, it couldn't be easier to get up and running with RoR thanks to a one-click installer and administration application called Locomotive. Here is a quick tutorial to get you started.

  • Download Locomotive and install it by opening the image file and dragging the application to your Applications folder.
  • Run Locomotive and click the + button in the control bar. Select "Create New" from the button's menu.
  • Give your application a name and select the directory (folder) that Locomotive should create it in.
  • Press the Create button

That's it, you've created your first rails application!

To run the server for your application, select the application's name in the applications list in Locomotive and press the Run button. Now go to http://localhost:Port (where port is the port that is listed next to the application's name in Locomotive) and you will see the default Rails welcome screen.

One caveat: If you're using MYSQL via MAMP, you need to add the following line "socket: /Applications/MAMP/tmp/mysql/mysql.sock" to your database configuration file (config/database.yml) when working with RoR. That one caught me out until I found the note in Locomotive's help files.

To learn more about rails, check out the tutorials on the Ruby on Rails web site.

So how does this all apply to Flex/Flash development? Well, MidnightCoders has a Flash Remoting solution for Ruby on Rails called WebORB for Ruby on Rails that supports both AMF0 and AMF3...

Post Metadata

Date
September 28th, 2006

Author
Aral

Category

Tags


2 Trackbacks & Pingbacks

  1. July 10, 2007 8:02 pm

    dirtystylus » Blog Archive » Locomotive on Rails, with MAMP as a Caboose :

  2. September 17, 2007 4:41 pm

    SWX Ruby Alpha Released: SWX RPC for Ruby on Rails at Aral Balkan :

5 Comments

  1. i have appended the MAMP socket code, but still get an error on rake:

    Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

    wondering what i am doing wrong…


  2. I found the answwer here:

    http://forum.refreshorlando.org/read.php?13,180,186http://forum.refreshorlando.org/read.php?13,180,186

    Basically what the Locomotive Help doc won’t tell you is you have to add the string “socket: /Applications/MAMP/tmp/mysql/mysql.sock” to the config/database.yml file like so:

    development:
    adapter: mysql
    database: myapp_development
    username: root
    password:
    host: localhost
    socket: /Applications/MAMP/tmp/mysql/mysql.sock

    THEN, Locomotive and MAMP know how to play nice together for the rake!

    Thanks!



  3. aral

    Thanks for updating us — much appreciated! :)



  4. DamianT

    Mate - thanks for the tip about using MAMP - adding socket: /Applications/MAMP/tmp/mysql/mysql.sock
    Much appreciated!!



  5. JamesP

    So would that mean I would have to do the same if I am using WAMP?

    Thanks for the time and efforts?


Leave a Reply



Bad Behavior has blocked 0 access attempts in the last 7 days.