May 2, 2014

Ruby in Windows... What to do?



85% of Ruby on Rails Developers does not like windows machine... Reason they say windows machine will gives more conflict. If developer uses Linux then its very much easy to install the gem files.

Ruby> Its an language similar to Java, C, C++

Rails> It is a Framework which is developed from Ruby language to create WEB applicaitons.

Why Ruby on Rails? or Why ROR?
Faster in development
Ruby language is easy to learn.

with Ruby you can integrate with any types of application.

Ruby Site URL: http://ruby-lang.org/
Ruby on Rails Site URL: http://rubyonrails.org/

In Ruby; Everything is consider as an object...


Its time to work on Ruby in Windows.

1) Download the windows installer executable file in the below URL
http://rubyinstaller.org/

2) run the exec file and follow the installation steps...

It you are using the Executable file then the Environment variables are defined by its own.....


Suppose If you are trying with the Ruby folder package, then set Environment variable.

My System Env Variable: C:\Ruby192\bin

3) go to Start> Run > irb

It will open ruby console.....

that's it.... Its your time play with ruby language......

commands used>
Open command prompt:

> which ruby
> Where ruby
> gem list
> irb

===========================================================================
Query Running in your mind:
Q: Okay, This is already mentioned in many places. Then what is the special in this blog post......


Answer: Gem File> It is Similar to supporting Library file. Which contains predefined method and classes like an package

You can download the Gem file in below URL

>> http://rubygems.org/

If you wanna download any gem file, then

Open command prompt
> Gem list
> gem install <gem name>

whenever you give gem install then gem is downloaded from ruby gems repository to your local machine.....

> gem list
you can view the installed gems in your local machine

> bundle show <gem name>
You can view the path of the gem location

========================

gem installing few gems in windows, It will throw error....

It will ask you to install the Devkit in your machine.....

================================
If you feel error is not resolved, dont find any solution to proceed....  Struggling a lot and have no idea about the error in installing gem...

Then remove the gem folder in Ruby installed folder.... Where ? How?

FOLLOW THE BELOW:
1) Goto your command prompt

2) Look for ruby installed location
> where ruby
In my system
C:\Users\JeganRajKumar>where ruby
C:\Ruby193\bin\ruby.exe

3) then goto the gem file downloaded location. which is available in your library folder......
In my machine
C:\Ruby193\lib\ruby\gems\1.9.1\gems

4) Either rename the Gems folder or delete it... Rename will be the better option... You can have it as back up

5) In command prompt give GEM LIST command... It will show empty gem list....
> gem list

6) So we removed all the installed GEMS... Its time to install the gem files again... Now it will work....
Enjoy installing the ruby gems in WINDOWS

No comments:

Post a Comment