hello friends! new(ish)!
Ruby on Rails: Difference between revisions
>Eva-02 No edit summary |
>Eva-02 No edit summary |
||
Line 6: | Line 6: | ||
It is recommended to use Ruby in an Unix-like environment. Linux and OSX are great choices for Ruby programming, as they provide an extremely comfortable environment for developing Ruby software. | It is recommended to use Ruby in an Unix-like environment. Linux and OSX are great choices for Ruby programming, as they provide an extremely comfortable environment for developing Ruby software. | ||
If you use Linux, your distribution very likely has a version of Ruby packaged and ready to be installed through the package manager. Search your repositories for a ruby implementation, install it and you're ready to go. That is the quickest, simplest way to install Ruby. | |||
=== RVM === | |||
Many different implementations of Ruby exist. In order to live in such an heterogeneous environment, Rubyists created [http://rvm.io/ RVM]. It was originally a tool to make switching between Ruby implementations as painless as possible, but has since evolved to be capable of much more. | |||
RVM will: | |||
* Manage your entire Ruby environment | |||
* Fetch, patch, compile and install Ruby implementations | |||
* Allow you to switch between them seamlessly and at any time | |||
* Allow you to switch between them on a per-project basis | |||
* Allow you to create an isolated environment containing only the gems you want | |||
To install RVM, you can run the following command: | |||
<code>\curl -sSL https://get.rvm.io | bash -s stable</code> | |||
RVM will add itself to your shell's initialization file. You should restart your terminal after it completes. | |||
You can then install a Ruby implementation: | |||
<code>rvm install 2.1.0</code> | |||
To get a list of available Ruby implementations, enter: | |||
<code>rvm list known</code> | |||
=== Windows === | === Windows === | ||
Line 11: | Line 39: | ||
Ruby is supported on Windows via [http://rubyinstaller.org/ RubyInstaller]. It includes pre-compiled binaries of the reference Ruby implementation as well as the standard library and executables. However, while it will work on Windows, it will be very awkward to run Ruby programs and develop projects due to the lack of a good terminal. | Ruby is supported on Windows via [http://rubyinstaller.org/ RubyInstaller]. It includes pre-compiled binaries of the reference Ruby implementation as well as the standard library and executables. However, while it will work on Windows, it will be very awkward to run Ruby programs and develop projects due to the lack of a good terminal. | ||
=== IDEs === | |||
Ruby enjoys some IDE support. The [http://www.eclipse.org/dltk/ Eclipse Dynamic Languages Toolkit] offers an integrated environment, and [http://www.jetbrains.com/ruby/ RubyMine], from JetBrains, is a full-fledged Ruby IDE. | Ruby enjoys some IDE support. The [http://www.eclipse.org/dltk/ Eclipse Dynamic Languages Toolkit] offers an integrated environment, and [http://www.jetbrains.com/ruby/ RubyMine], from JetBrains, is a full-fledged Ruby IDE. | ||
However, Rubyists tend to not use IDEs, relying only on their trusty editor and terminal to develop software. This is most likely due to their choice in operating system. IDEs are valuable for Windows users. | However, Rubyists tend to not use IDEs, relying only on their trusty editor and terminal to develop software. This is most likely due to their choice in operating system. IDEs are valuable for Windows users. |
Revision as of 01:41, 7 February 2014
Ruby is a general-purpose dynamic programming language. Having been inspired by Smalltalk, Ruby displays a very high degree of object orientation, but it also features Perl's strong text processing and Unix programming abilities and Lisp's metaprogramming facilities.
The language was created in 1995 by Yukihiro Matsumoto, often referred to as "Matz" in the Ruby community, and is now at version 2.1. Ruby has a strong focus on programmer happiness, its motto being "A programmer's best friend". It achieves that goal by being simple, powerful, practical and predictable. It features elegant and readable syntax that is easy to write and read, as well as nice APIs to use and a great standard library. When learning, you can often guess a method name correctly.
Installation
It is recommended to use Ruby in an Unix-like environment. Linux and OSX are great choices for Ruby programming, as they provide an extremely comfortable environment for developing Ruby software.
If you use Linux, your distribution very likely has a version of Ruby packaged and ready to be installed through the package manager. Search your repositories for a ruby implementation, install it and you're ready to go. That is the quickest, simplest way to install Ruby.
RVM
Many different implementations of Ruby exist. In order to live in such an heterogeneous environment, Rubyists created RVM. It was originally a tool to make switching between Ruby implementations as painless as possible, but has since evolved to be capable of much more.
RVM will:
- Manage your entire Ruby environment
- Fetch, patch, compile and install Ruby implementations
- Allow you to switch between them seamlessly and at any time
- Allow you to switch between them on a per-project basis
- Allow you to create an isolated environment containing only the gems you want
To install RVM, you can run the following command:
\curl -sSL https://get.rvm.io | bash -s stable
RVM will add itself to your shell's initialization file. You should restart your terminal after it completes.
You can then install a Ruby implementation:
rvm install 2.1.0
To get a list of available Ruby implementations, enter:
rvm list known
Windows
Ruby is supported on Windows via RubyInstaller. It includes pre-compiled binaries of the reference Ruby implementation as well as the standard library and executables. However, while it will work on Windows, it will be very awkward to run Ruby programs and develop projects due to the lack of a good terminal.
IDEs
Ruby enjoys some IDE support. The Eclipse Dynamic Languages Toolkit offers an integrated environment, and RubyMine, from JetBrains, is a full-fledged Ruby IDE.
However, Rubyists tend to not use IDEs, relying only on their trusty editor and terminal to develop software. This is most likely due to their choice in operating system. IDEs are valuable for Windows users.