|
Rails 2 |
2007-12-05 |
|
I started playing around with Ruby on Rails in late June. I know this because I recorded the date June 30th at the top of my notes titled "Ruby stuff". The "Ruby stuff" page contains the following:
Starting the web server:
ruby script/server
Creating a new controller:
ruby script/generate controller controller_name
To run ruby in console mode, run
ruby script/console {production|development}
Development is the default if no argument is offered
That's it. I like taking notes when I use some new language or technology so I can come back months later and work out how the heck I ever got whatever-ing to work. In this case, I stopped taking notes after starting console mode. So Ruby on Rails is very easy to program: script/generate creates files ready to be filled up with Ruby; MVC is baked in and the M bit is automated down to the database; Rails provides convenient methods for accessing the model called finders that let me create a type Thing with a name property and then call Thing.find_by_name(…) . And because this is just recreational programming I don't care about perf, I don't even need to know the database is there, or what that dynamic method cost me. So I went off and wrote some new blog software, and even put in some new features: tags, multiple users, a kml feed (which I will post about later), and an RSS migrator. This was precipitated, btw, by Dominic quitting his .Net hosting. Back to my notes. The next page is title "Setting up rails app on dreamhost". There is no actual blood, sweat or tear stains on this page, but only because I wiped the monitor down. The page contains the following: set up the rails app with the command "rails directoryname" sync the app from svn change the home directory to /public, wait 10 mins stand on one foot edit the fcgi file kill any dispatch.fcgi processes stand on the other foot put the app into production by editing the config file kill any dispatch.fcgi processes … OK so it wasn't quite like that. But it was close. And it took a long time. Apparently Dominic has capistrano deployments working. I guess I need to look into those! Tags:
programming |
|