Home   -   Computerkurs   DemoMatrix   Editpointstatic   Folderwatcher   Gipsydrive   Licenses   Shrinkseries   V4   More...  

Apache   Chrome   Firefox   MySQL   NetBeans   Niwa   OXID   Opera   PHP   Ruby   SharpDevelop   Subversion   Tools  

Session Diaries:   One   Two   Three   Four   Five   Six   Seven   Eight  

Previous page Home chapter Next page

Ruby logo

Link

Trilo - Downtown - Gipsydrive

Ruby and Rails

Subchapters below:   Usage   Versions   Diaries   Q & A   More  

Project status : Mostly working
Platform : Windows
Dependencies : None
Description : Gipsydrive is a collection of Windows applications, held in Subversion repositories to be checked out and run immediately on any Windows machine. One of those applications is Ruby, which comes in three separate flavours: Ruby 1.8.7, Ruby 1.9.3 and Ruby 2.0.0.
Checkout : Ruby 1.8.7 from app.ruby1, Ruby 1.9.3 from app.ruby2 or/and Ruby 2.0.0 from app.ruby3

Link

Usage

(1)   Checkout to your drive

Gipsydrive applications are mostly independend from drive letter and path, but sorrily not with Ruby. The reason is, that Ruby installations write physical pathes into many of their files. So the checkout from app.ruby1 or app.ruby2 or app.ruby3 will only work out of the box, if checked out to a folder exactly named like this:

If you really need a different path, you can adjust to it by exchanging all path occurrences in the checked out files with your specific one. This occurres in about 22 files. Ruby internally uses normalized pathes, means with slashes instead backslashes, and not always with the drive separator ':'. So your search string has to be a bit creative. E.g. just search for 'gipsydrive' or 'app.ruby'. All files are textfiles, except one binary file atomic_reference.o, I am not sure yet how to process this one, or whether it does matter at all.

An automatic path adjustion is on the todo list, but not ready for now.

If you can satisfy the drive letter requirement, a plain checkout of one of the Ruby application repositories should be sufficient to get you an immediately working Ruby environment.

The installations are maintained on Windows XP 32 bit so far. For Windows Vista/7/8 and 64 bit machines I have no experience yet, so perhaps expect some fiddling with the user rights.

(2)   Open a Ruby console

Doubleclick the start batch file to open a console with a prepared environment. The batchfiles per Ruby are:

In the opened console, you can issue commands like >gem list to view all installed Gems or >ruby -h to view the Ruby help screen. And all other commands.

Link

Spoiled programmers may want desktop icons to reach the Rubies always with just one doubleclick.

Image 20140216°1711
Optional desktop icons to the start batchfiles.
(img 20140216°1711)

(3)   Special requests?

If you want run Ruby (1) from any console or (2) from your local Apache server, you need to additionally provide pathes in your machine's global environment path variable. If so, set two pathes like this:

For setting global pathes, of course you have to decide for only one of the three Ruby flavours. Don't worry about the start batchfiles, they do not interfere with a global path, they will still work anyway for their dedicated Ruby flavour.

If you want run Ruby scripts by just doubleclicking a Ruby script file, you can register the filename extension '.rb' to be executed with the Ruby of your choice. Go to e.g. 'Explorer - Tools - Folder Options - File Types' and register.

(4)   Run existing Rails application

You can run a Rails application from the built-in WEBrick server. Open a Ruby console, change to the Rails applications folder and start the server. The commands may look like this:

(5)   Run Ruby from your Apache webserver

To run Ruby/Rails via Apache, you need to prepare your Apache's config files correspondingly. Here is a snippet from my local Apache's httpd.config (note the red parts):

   # demosruby (20140128°0501)
   Alias /demosruby ../../../../downtown/demosruby/trunk
   <Directory "../../../../downtown/demosruby/trunk">
       Options Indexes FollowSymLinks +ExecCGI
       AllowOverride All
       Deny from all
       Allow from 127.0.0.1
       AddType application/x-httpd-php .php .htm .html
       AddHandler cgi-script .rb
   </Directory>

Link

Versions

Ruby and Rails are developing racy. It is not possible to fabricate one single installation being compatibel for existing projects of different age. This is the reason for the existence of three separate Ruby application repositories on Gipsydrive. Choose the one or more which suites your needs.

Repository Ruby Gems Rake Rails Targets
app.ruby1 1.8.7 1.6.2 0.8.7 (10.1.1) 2.3.11 Projects around 2010 and 2011
(Rails 2.x applications. Rails 2.x is not compatible with Gems >1.6.2 and Gems 1.6.2 is not available with Rails >1.8.x)
app.ruby2 1.9.3 2.1.11 0.9.2.2 4.0.2 Projects around 2012 and 2013
(Rails 3.x and 4.x applications)
app.ruby3 2.0.0 2.0.14 0..9.6 4.0.2 Projects started 2014

The stable Ruby version for today productive projects seems 1.9.3. Note the Announcement that support for Ruby version 1.9.3 will end on 2015-February-23.

Just for fun some incompatibility examples:

Any specific Rails application runs only with it's more or less precise Ruby configuration.

Link

Session Diaries

The sessions building up the Ruby repositories are documented on dusty diary pages. Normally, nobody wants read those bygone nasty details. This diaries are only for extremely curious readers. Or for those with the misfortune to have to fiddle with a Ruby installation and search for clues in the records.

This are the diaries:

Still more diaries about incompatibilities and the like quirks may be found behind demos-rb-rails.html.

Link

Questions and Answers

Where from comes the logo on top of this page? It comes from the Ruby Logo Kit (download 20140128°1211).

Link

More

More about Ruby and Rails on this domain you may find in chapter Demos - Ruby.

 

Imprint : www.trilo.de