Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Page Index Toggle Pages: 1
Send Topic Print
Understanding Ruby on Rails (Read 14107 times)
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Understanding Ruby on Rails
Oct 7th, 2008 at 3:14pm
 
hi.

was researching ruby on rails:

http://rubyinstaller.rubyforge.org/wiki/wiki.pl

http://www.rubyonrails.org/

i usually like to first get a handle on the STRUCTURE of the info, then let it 'gel' for a while .. before returning to it to learn more.

had some questions as to how things work.

i understand ruby is the programming language that works with rails, which is the "web application framework" .. right?

this is analogous to php (language) and the zend framework .. right?

http://framework.zend.com/about/overview

(better to get any conceptual errors cleared up before proceeding)

now i have d/l'ed and installed the latest stable release of ruby on my laptop:

http://rubyinstaller.rubyforge.org/wiki/wiki.pl

took a *long* time to extract all those files (3-K folders, 21+K files)

so .. do i understand correctly i need both ruby (language) + rails (framework) on BOTH my home PC *and* my web server??

i currently have rails installed, but i don't think i config'ed it to use a database:

http://radified.com/rails/

cuz i get an error when i click the link "About your application's environment":

http://radified.com/rails/rails/info/properties

Quote:
Application error

Rails application failed to start properly


rails was installed back when we were still at/with lunarpages.

my vps host (wiredtree) says cPanel will automatically update it to the latest stable release.

OR .. does ruby only need to be installed on my local machine?

i'm trying to understand how the final product works, and what is required to drive it.

i also understand i need a web server (like apache) for all this work, right?

most of the things i've read online assume you already understand these basics concepts.

can somebody break it down for me?
 
WWW  
IP Logged
 

Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Understanding Ruby on Rails
Reply #1 - Oct 7th, 2008 at 3:28pm
 
okay, i opened a cmd prompt on my laptop and typed:

Code:
gem install rails --include-dependencies 


and it seems to be installing rails:

Quote:
"Bulk updating gem source index for gems.rubyforge.org"

Not sure how Windows knows about Ruby, cuz it only seems as if the "installer" merely unpacked a buck of files.

but this is a good start.
 
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Understanding Ruby on Rails
Reply #2 - Oct 7th, 2008 at 3:34pm
 
ooh .. more stuff now appearing in cmd prompt:

Quote:
successfully installed rails2.1.1
successfully installed rake-.0.83
successfully installed activesupport-2.1.1
successfully installed ...

.. lots of other stuff. see attached graphic.
 
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Understanding Ruby on Rails
Reply #3 - Oct 7th, 2008 at 3:50pm
 
i think this means i now have both ruby and rails installed on my local machine.
 
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Understanding Ruby on Rails
Reply #4 - Oct 7th, 2008 at 4:50pm
 
can't find my /rails installation. checked all the places where it might be .. such as in the /ruby folder, and where the cmd prompt runs from (its default location), and c root, and same place as drive as /ruby folder.

can't find it. just curious where it might be.
 
WWW  
IP Logged
 
Nigel Bree
Ex Member




Back to top
Re: Understanding Ruby on Rails
Reply #5 - Oct 7th, 2008 at 11:15pm
 
Rad wrote on Oct 7th, 2008 at 3:14pm:
i understand ruby is the programming language that works with rails, which is the "web application framework" .. right?

Ruby is basically a simple programming language which combines these three elements:
a) the UNIX "pipe" philosophy, which makes it fit well into the CGI script kind of space just as Perl does
b) a subset of the expressive power of Lisp,
c) that Lisp goodness packaged in a surface syntax intended to be attractive to users of Perl and Python

[ Note that not only is that the first impression a Lisp-aware programmer gets of Ruby, it's actually pretty close to Matz's actual design process, since he himself set out precisely to make a simplified subset of Lisp. ]

Rails is two things, the bulk of which is the client-side Web framework itself (that has nothing whatsoever to do with Ruby the language) and the other being some server-side Ruby code which uses Ruby's Lispness (much as Seaside does for Smalltalk or a Lisp programmer would) to make it easy to do the server-side programming to work with the client-side Rails code.

Really, although there's nothing particularly "special" about the language (which is not to diminish Matz's skill in doing a very nice job of selecting some crucial features from Lisp and Smalltalk and making them accessible to modern developers without neutering those borrowed features in the process) or the Rails Web framework, there was just very impressive luck in timing, which allowed Ruby and Rails together to ride the wave of the "Web 2.0" hype into acceptability.
 
 
IP Logged
 

Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Understanding Ruby on Rails
Reply #6 - Oct 8th, 2008 at 1:45am
 
having trouble i think figuring out how to get ror config'ed on rad server.
 

WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Understanding Ruby on Rails
Reply #7 - Oct 8th, 2008 at 1:47am
 
Quote:
You have two rails directories. Try copying the content from ~/public_html/rails into ~/rails and see if that makes a difference. In any case, this is a coding issue and not something that we support. Please let us know if you have any other questions.

Quote:
I see two issues. First, I see you have your rails directory created via cpanel as /home/radif2/rails, however your files are in /home/radif2/public_html/rails

Second, I have the following log excerpt. It looks like you are missing a gem.

[root@host ~]# tail -f /home/radif2/rails/log/mongrel.log
    Install the missing gem with 'gem install -v=1.2.3 rails', or
    change environment.rb to define RAILS_GEM_VERSION with your desired version.
 
** Daemonized, any open files are closed.  Look at log/mongrel.pid and log/mongrel.log for info.
** Starting Mongrel listening at 0.0.0.0:12001
** Starting Rails with production environment...
Cannot find gem for Rails ~>1.2.3.0:
    Install the missing gem with 'gem install -v=1.2.3 rails', or
    change environment.rb to define RAILS_GEM_VERSION with your desired version.
 

install_gem.png (15 KB | )
install_gem.png
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Understanding Ruby on Rails
Reply #8 - Oct 8th, 2008 at 12:25pm
 
Here is the latest with RoR:

Quote:
Ruby and Ruby on Rails are installed correctly on your server.  The issue is that your App is not working.  Our support for debugging your rails applications is beyond our support.  Now with that said I want to try to help you but there is only so much that I can do.  Basic rails app troubleshooting is always to look in the rails app logs

I can see that your rails app is running its mongrel process:

[root@host log]# ps aux |grep mongrel
root      7856  0.0  0.0   2916   700 pts/0    S+   12:12   0:00 grep mongrel
radif2   20448  0.0  2.6  31828 28112 ?        S    01:33   0:01 /usr/bin/ruby /usr/bin/mongrel_rails start -p 12001 -d -e production -P log/mongrel.pid

So at this point its clear that its an issue with your rails app so lets check the logs:

[root@host log]# pwd
/home/radif2/rails/log
[root@host log]# ls -la
total 20
drwxr-xr-x  2 radif2 radif2 4096 Oct  8 01:37 .
drwxr-xr-x 14 radif2 radif2 4096 Feb 19  2008 ..
-rw-rw-rw-  1 radif2 radif2  684 May 13  2007 development.log
-rw-rw-rw-  1 radif2 radif2 2400 Oct  8 01:37 mongrel.log
-rw-r--r--  1 radif2 radif2    5 Oct  8 01:37 mongrel.pid
-rw-rw-rw-  1 radif2 radif2    0 May 13  2007 production.log
-rw-rw-rw-  1 radif2 radif2    0 May 13  2007 server.log
-rw-rw-rw-  1 radif2 radif2    0 May 13  2007 test.log
[root@host log]# tail -n100 development.log

Processing InfoController#properties (for 75.28.66.149 at 2007-05-13 17:16:39) [GET]
 Session ID: c2fe36abc6e691fc1e02d5c22aa352a0
 Parameters: {"action"=>"properties", "controller"=>"rails/info"}
Completed in 0.00074 (1353 reqs/sec) | Rendering: 0.00005 (6%) | 500 Internal Server Error [http://radified.com/rails/rails/info/properties]

Processing InfoController#properties (for 75.28.66.149 at 2007-05-13 17:16:39) [GET]
 Session ID: 484bb234d7859ad2073fdca5a1017af7
 Parameters: {"action"=>"properties", "controller"=>"rails/info"}
Completed in 0.00075 (1338 reqs/sec) | Rendering: 0.00005 (6%) | 500 Internal Server Error [http://radified.com/rails/rails/info/properties]

Its kicking out a 500 Internal Server error which means there is something wrong with your rails code.  I hope that points you in the right direction.

I do not know where that rails app came from. I'm assuming my old host (Lunarpages), who installed RoR for me, also installed that (dysfunctional) app.

So I thinking of deleting it and creating and installing a new one. Does that sound like a good idea?
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print