Posts Tagged ruby

Free ad space if you donate to RVM

Hello People,

I am very much fond of rvm http://rvm.io/ . All the apps I have deployed runs on it. RVM needs funding so that it can be developed further. I want to hasten the process of funding.

I have written a ruby programming book named ‘I Love Ruby’ thats totally free, you can get it here http://goo.gl/FW6slH (this book will be released on jan 2014 or earlier)

If you donate $2000 to RVM I will grant full page advertisement, half page for $1000 and quarter page ad for $500. If you have donated these amounts you can contact me on mindaslab at gmail dot com so that I can put your ad in it.

The advertisement will stay till Jan 31 2014. It must be designed by you.

Please donate to RVM by going to https://www.bountysource.com/fundraisers/489-rvm-2-0

Advertisements

, , , ,

Leave a comment

Very Simple Search for Active Records

Okay, you might encounter a need to put very simple search for active record / model in your Rails app and here is it. Put this code in your active record model:

Note this line

columns = [:name, :address, :city, :pin, :ph]

in the code snippet, give your own column names in that array.  This array can contain columns that are string and text type. Lets say you have put these stuff in a class called Person , to search it you need to issue a command like this

Person.search "Karthik chennai"

This stuff works well with Sqlite, Postgre and MySQL. If you have tried this out with other DB, please add it in comments. Bye.

, , ,

Leave a comment

Launching Ruby Links

Possible Ruby Links Logo

Possible Ruby Links Logo

Hello people. One problem with Ruby and its spinoffs like Rails, Sinatra and blah blah is that its documentation, books, tutorials are scattered all over the internet. I was wondering could this all be got under one place. In fact Google has done it. But is googlean excellent vertical specific search engine and book marking thing? No. Well I present you with http://rubylinks.net .

This is not a search engine though, all you can do is, if you find a great link about Ruby and its allied technology, you can post it here. If soe one likes it, they can jewel it. You are presented with your own page here all the links posted and jeweled by you are listed, so that there is no need for you to scratch your head and say, “where did I see that?”

Ruby Links is a free software, hosted here https://github.com/codetribe/ruby_links , please post bugs and suggestions there, ad if possible contribute for the benefit of Ruby community.

, , ,

Leave a comment

Learning Postgre is Quiet Essential

When its in PHP, people always proffered LAMP, that is PHP running on Apache server,  data stored in MySQL and all this runs on Linux server. Now Rails is slowly bt surely chipping into PHP’s territory. ore people like to start their project with Rails than with PHP (at least the people I know). Or should  I say Sinatra as its very easy to learn.

Now there is a change here. MySQL was popular with Rails, but its no more now. Not because its technically inferior to Postgre, but because its owned by Oracle. Oracle is a big company. Its just interested in making profit unlike the free software community which is interested  in delivering software to people so that they can benefit out of it. This corporate interest has made MySQL stall. The initial creator of MySQL, Monty Widenus has even started another project called MariaDB, a drop in replacement to MySQL.

But the mood in Rails community is clear. Most Rails apps as far as I know run with PostgreSQL. So learn Postgre. If your app receives lot of hits, possibly tou might dig deep into raw sql to improve its performance. Postgre also has a thing called Geographic Information System in which you can store geographic data, and ask queries like ‘which is the bakery thats nearest to my home?’ and so on.

So if you are interested really and are sure that your app will be popular, use and dig into PostgreSQL.

, , , , ,

Leave a comment

Upgrading to Ruby 2.0

If you are using the rvm for managing Ruby versions and are in Ruby 1.9.X version and want to upgrade to Ruby 2, this blog will help.  So hoping that you have installed rvm on your system this is how you upgrade to Ruby 2.0

First in your bash / terminal you need to tell rvm to check for latest stable release of Ruby. For that type this command (of course without the $)


$ rvm get stable

This will update rvm  with latest stable releases. Now you can get the list of known by typing this command


$ rvm list known

This will list some stuff like this


# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p371]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3-p125
[ruby-]1.9.3-p194
[ruby-]1.9.3-p286
[ruby-]1.9.3-p327
[ruby-]1.9.3-p362
[ruby-]1.9.3-p374
[ruby-]1.9.3-p385
[ruby-]1.9.3-[p392]
[ruby-]1.9.3-head
[ruby-]2.0.0-rc1
[ruby-]2.0.0-rc2
[ruby-]2.0.0[-p0]
ruby-head

Notice that you have [ruby-]2.0.0[-p0] which is nothing but but Ruby 2.0,to install it type this


$ rvm install 2.0.0

Once installed to use Ruby 2.0 just type this


$ rvm use 2.0.0

Now how to switch to other versions of Ruby, well just type


$ rvm list

This will list the versions of ruby available in your system, the following is the out put in my system


rvm rubies

=* ruby-1.9.3-p362 [ x86_64 ]
ruby-2.0.0-p0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

This shows I have Ruby 2.0 and Ruby 1.9.3-p362. To switch to  Ruby 1.9.3-p362 (in my case) type


$ rvm use 1.9.3-p362

and you would have switched to that version of Ruby!!!

, , ,

Leave a comment

Best bits of Ruby 2.0

Best bits of Ruby 2.0

,

Leave a comment

Ruby Style Guidelines Being Developed

Ruby style guidelines are being developed. Please checkout https://github.com/bbatsov/ruby-style-guide

, , , , ,

Leave a comment

%d bloggers like this: