Archive

Posts Tagged ‘ruby’

Ruby on Rails application in 10 minutes is a myth

April 2nd, 2009 5 comments

Lately netbeans remainded me about something that makes great marketing for Ruby on Rails – ability to create application in 10 minutes.

By example you can have a look on the netbeans tutorial. Everything looks great, sometimes You can even create the application in 10 minutes …

Lets think what You will get in this 10 minutes:

  • Scaffold of application … without head or legs

Thats all, the application generated in 10 minutes does not have authentication, it does not have administrative part. Of course there is a lot of plugins, that helps to add functionality to Yours application. But wait a minute, authors of this plugins cant catch up stable rails.

Each few months we have new rails version, and each version is requiring application changes, this is endless. After You finish migration to newest rails, after You find new plugins there is new rails version – and the  wheel spins again.

Comparing to other applications rails is getting new releases at least twice offten, that would be good if it would have one stable base, but not, the base is changing each few months.

And what is the plan, four months after rails 2.3 we will have rails 3.0, it will be more like rails or maybe more like merb? Hopefully it will start slowing down a bit, as it requires now very big efforts to maintain application and keep it up todate.

Somebody would say “You can freeze rails, gems and plugins” – yes I can, but I can not freeze my developers, they will learn new rails version, and after one year I will have a team of experienced developers in rails 4.0 or even rails 5.0 and application with frozen reail 2.3 … and try to migrate when the core was rewritten three times during last year.

Assuming having steady framewoirk with “broken tables” like Java or less broken DJango makes a lot more work on begining, but development stacks are available, the documentation is more complete, and the major version changes once for few years, this allows developer to understand and modify application code even after ten years.

Did You liked this post or maybe not, vote on it at dzone.

Categories: Development Tags: , ,

Linux did 1234567890 seconds past 1970′

February 14th, 2009 Comments off

That’s not so important for our development and live,  but as always interesting dates get our attention, todays date will have interesting representation as seconds since start of 1970 year.

1234567890, that showed to me when I have entered the following command and waited a while before  2009-02-14 00:20

while [ $((1234567890 – $(date +%s))) -ge 0 ]; do sleep 1s; clear; date +%s; done

Of course You need to know that Linux is counting time as seconds since begun of year 1970.

Thanks to polish linux blip community for remembering me this very important fact.

Quick update from polish rails blip community, the date for ruby was the same when converting to integer:

irb

Time.now.to_i

Good to hear that not only Linux is affected by this issue.

Categories: Linux Tags: , , ,

Preparing Ruby on Rails environment – netbeans

January 25th, 2009 4 comments

In previous steps we have configured ruby and apache, now time to get development environment, there is wide range of tools but we will use Netbeans as it is … quite good.

So on beginning please download Netbeans, please go to it’s download site and get “C/C++” or “PHP” version – they are smaller from the ruby version, we need to update the environment after download so we would download many components again.

After download run the Netbeans installation, it is very simple so just follow the on screen instructions. When Netbeans is installed please run it and go to Tools Menu -> Plugins, there select available plugins and select:

  • Ruby and Rails
  • Ruby Extra Hints
  • Extra Ruby Color Themes

Do not install “Glasfish” or “JRuby” this is needed only for JRuby development which is not production ready, as some people think.

Additionally to installation You can perform update of the installed plugins in the Updates tab, after update and installation Netbeans will ask You to do restart to activate newly installed plugins, please follow it’s instructions.

When we have installed required plugins we can check that Netbeans sees our ruby installation, go to Tools Menu -> Ruby Platforms, here you will see yours ruby installations and it’s configuration, If you do not see any platform go threw the wizard under button Add Platform.

This is the development environmnet, in next part we will start a new project with it.

Categories: Development, Linux Tags: , , ,

Preparing Ruby on Rails environment – apache, ruby

January 24th, 2009 Comments off

In previous article I have described how to setup postgress for development, now is time to continue with the environment. At the beginning we need:

  • ruby as it is base for rails,
  • apache For serving pages,
  • java + netbeans for development.

So installation of required system packages:

emerge -qDNu ruby rubygems apache jdk

/etc/init.d/apache2 start

Install ruby gems that will be needed shortly:

UPDATE: 2009.01.26 added postgres

gem install rails capistrano capistrano-ext passenger postgres

Now we need to integrate passenger into apache – please run:

passenger-install-apache2-module

UPDATED 2009-02-06:

The installation should go without nay problems (If You followed all instructions), at the end You will be asked to modify apache configuration file – few Lines of the output – starting with LoadModule, PassengerRoot and PassengerRuby – should be copied to new apache configuration file, easiest way is to use this commands:

echo “LoadModule passenger_module /usr/lib64/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so” > /etc/apache2/vhosts.d/01_passenger.conf

echo “PassengerRoot /usr/lib64/ruby/gems/1.8/gems/passenger-2.0.6” >> /etc/apache2/vhosts.d/01_passenger.conf

echo “PassengerRuby /usr/bin/ruby18” >> /etc/apache2/vhosts.d/01_passenger.conf

Some of the lines may differ from the output form yours passenger so please use Yours as it is better for you.

In next part we will continue with development environment.