Posts Tagged ‘Ruby’
Ruby on Rails for CentOS 5
Install Rails
yum install rubygems
yum install ruby-mysql
gem update --system
gem install rails
Creating the Application
rails xxx -d mysql
Setup the database
gvim config/database.yml
Top Ruby on Rails Plugins
These are my most used Ruby on Rails plugins:
active_merchant : e-commerce system
action_mailer_tls : Use Gmail’s SMTP
auto_complete
will_paginate
acts_as_tree
annotate_models : comment
restful_authentication : user authentication
acts_as_taggable_on_steroids
acts_as_versioned : ar-versioned
bundle_fu
exception_notification : sending email notifications when errors occur
render_component : call other actions for their rendered response.
calendardateselect
contacts
ssl_requirement
globalite : i18n/l10n
authgasm : Authlogic : authentication solution
acts_as_xapian
acts_as_rateable
rspec : Behaviour Driven Development framework
attachment_fu : file upload
sms_fu
rspec-rails : rspec_on_rails
dialog_helper
permalink_fu
engines : enhances Rails’ own plugin framework
acts_as_paranoid : ar-paranoid
cache_money : caching library for ActiveRecord
assert_select
factory_girl
guid : makes the “ID” field into a URL-safe GUID.
markaby
query_trace
simple_captcha
tzinfo_timezone : a replacement for the TimeZone class.
gruff : A library for making beautiful graphs.
localized_dates
routing-filter
ultrasphinx : Sphinx full text search engine.
state_machine : creating state machines for attributes.
shoulda : Making tests easy.
open_id_authentication
paperclip : file attachment library
upload_progress : track the uploaded status.
tiny_mce
responds_to_parent
testable-logger
rails-dev-boost : 10 times faster in development mode
redbox : lightbox library
headliner : DRYs up your page titles.
open_flash_chart
juggernaut
google_charts_on_rails : wrapper for the Charts API from Google.
asset_packager : CSS Asset Compression
calendar_helper
acts_as_nested_set
model_2_protobuf
rails-widgets : a collection of UI Widgets for RubyOnRails
unobtrusive
role_requirement
query_reviewer : advanced SQL query analyzer
mysql_index_prefix
clippy : Flash widget that place arbitrary text onto the client’s clipboard
active_scaffold
annotatedtimeline-for-rails : wraps up the Annotated Timeline widget
active_scaffold_export
strip_attributes : strips model attributes of leading and trailing whitespace
mongrel_proctitle
recaptcha
rake_tasks
custom_err_msg
action_mailer_layouts
active_record_base_without_table
acts_as_list
acts_as_rated
vote_fu
lipsiadmin
searchgasm : Searchlogic
acts_as_authenticated
authentication
mbleigh-subdomain-fu
Ruby on Rails for CentOS 4
The Ruby provided in CentOS is 1.8.1, it’s too old. At least 1.8.3 is required for RubyGems. The good news is that CentOS-Testing has the new Ruby version.
Setup CentOS-Testing
gvim /etc/yum.repos.d/CentOS-Testing.repo
[testing]
name=CentOS-$releasever - Testing
arch=$basearch&repo=testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
gpgcheck=1
enable=0
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
Install Ruby
yum --enablerepo=testing install ruby ruby-devel ruby-rdoc
Install RubyGems
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz
tar xvzf rubygems
ruby rubygems-1.3.4/setup.rb
Install Rails
gem install rails
PHP vs Java vs Ruby
Learning curve
PHP is easy to learn, fast to deploy.
typical J2EE developer needs to read 1000’s of pages about various web frames works, template engines to make choice and do perfect deployment. Few people have that patience.
Even though Ruby’s dynamic typing, it’s easy than Java.
Scalability / Availability
PHP can run on all the Dedicated Server, VPS, Shared host.
Java and Ruby rarely can run on Shared host.
Development Speed
Development speed on Ruby on Rails is fastest.
PHP also has some quick development framework such as CakePHP.
Java is the slowest.
Maintainability
Java and Ruby have good maintainability.
PHP script is a bit hard to maintenance.