header image

Archive for the 'Rails' Category

Canada on Rails observations

Tuesday, April 18th, 2006

According to more people (including me), the nicest wrapup of the Canda on Rails conference can be found here: Canada on Rails, Day One and here (part 2): Canada on Rails, Day Two.

Some things i found interesting/funny:

The first speaker was (surprise, surprise!) David Heinemeier Hansson. He had an interesting slide:

IMG_0880

Alex’s comment:

“David explains in no uncertain terms that some people do shout quite loudly for features to be brought into rails core and when it makes sense to incorporate those features he does, but sometimes it really makes no sense and so he tells them a frank “no” and this sometimes seems to cause people to complain and even threaten to stop using “my free product” which elicits the response that you see in Davids presentation slide above. “

Hmm. Interesting explanation ;-) On the presentation of Amy Hoy:

Second to last was Amy Hoy, and I dont think I need to tell you that she did a great job. Her talk was entitled “Ajax with Rails” so she actually got to demonstrate some live code and even wrote some for us in real time in response to a question someone in the audience asked…

I wish i had the nerves to do this, usually i am happy if i can present my prepared slides at a conference, not write LIVE CODE ;-)

For the full event description read Alex’s blog.

Another nice conference notes can be found here: At the canada on rails conference.

tags:

Getting started with Ruby on Rails

Monday, April 17th, 2006

More people keep me asking about how to get started with Rails. Here is my suggestion:

  • Installation
      • If you do not have Ruby installed, either get it from http://www.ruby-lang.org , or use the package management system of your distribution.
      • Install RubyGems:download it from http://rubygems.rubyforge.org, unpack and install with
        sudo ruby setup.rb
      • Install rails:
        sudo gem install rails --include-dependencies

  • The tutorials
    • Probably the simplest thing after you have installed Rails is to start with Four Days On Rails. It is a simple and practical guide to get a quick overview of the possibilities of Rails, illustrated through building a real-life application.
    • Another very good inroduction is Curtis Hibb’s Rolling with Ruby on Rails. It is more detailed than the first tutorial, also includes a full installation guide (for Win32). Part 2 can be found here, and Ajax on Rails is the third part dealing with (surprise!) Ajax in Rails.
    • Amy Hoy has another nice introduction here.

  • Books
    • The bible of Rails development is definitely the Jolt-award winner Agile Development with Rails. If you would like to do more serious Rails development than just write some simple applications after reading the tutorials, i definitely recommend you to buy this book. The tutorials are very good to get the idea of what is RoR about, but they can not substitute the book.
    • There are more interesting books out there, like Rails Recipes or Ruby for Rails but to get you started, the above mentioned book should be enough. If you want more, be sure to check out these as well.

tags:

Ruby on Rails and Ubuntu

Saturday, April 15th, 2006

Although i have nice Ruby on Rails support at dreamhost, i have decided to install RoR to my local machine. IMHO a local RoR, combined with Radrails and WEBrick is the simplest and quickest solution, usually fully enough for development purposes.

To install Ruby on Rails, you just need to do 3 things:

  1. Install Ruby
  2. Install RubyGems, a package management system for Ruby
  3. Once you have RubyGems installed, it is a piece of cake to install new packages. In this concrete case:

gem install rails –include-dependencies

And you are on rails! This was easy, wasn’t it?

Well, yes, unless you happen to use Ubuntu .

Under Ubuntu, the MySQL-Ruby binding was outdated. No problem, just get the newest mysql-ruby gem:

gem install libmysql-ruby At this point the trouble begun. Instead of installing the mysql binding, i got every kind of nasty error messages, including:

ERROR:  While executing gem ... (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
ruby extconf.rb install mysqlnchecking for mysql_query() in
-lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no

WTH?! I have googled a day to find the problem, then also wrote to the RoR and Ruby mailing lists, but got no answer. As i came to know later, this happened because my problem had nothing to do with Ruby, Rails or MySQL. After several hours of trying every possibility, i have been checking the last one: Do i have gcc and make on my machine? Well, i did not! I have thought a decent linux distribution should have make, gcc et al - and i was wrong (considering that Ubuntu is a decent distro).

Ubuntu is a very nice distribution, for desktop usage. However, if you are planning to use it for development, compiling etc., double check whether you have basic development tools (apt-get install build-essential), gcc and whatever you may need for compiling/deploying your applications.

Or install Rubuntu

tags: