Log in

View Full Version : Ruby without commandline?



cancer10
11-13-2010, 04:53 AM
Hello

I come from a PHP background. I have been using frameworks )(Zend, cakephp) since years.

I am planning to learn Ruby. I want to make a small project in it but was wondering if its possible to make the project without using a command line. Every tutorial I read on the internet explains how to run your ruby code using command line. In Zend or cakephp, we have the option to either use the command line or download the framework library from their respective website and start using your favourite IDE and start coding.

1) Is this also possible in Ruby?

2) Can I download the framework library and start coding using Netbeans etc?

3) Is there any (step-by-step) tutorial available for the same?


Any help will be highly appreciated.


Many thanks


PS: FYI - I use Ubuntu 9.04 with apache 2.2

X96 Web Design
11-26-2010, 08:01 PM
I don't think you can use Ruby without a command line. I don't know why you wouldn't, it's way faster just to write one command and have the entire infrastructure built for you (similar to CakePHP's bake).

As for a step-by-step tutorial, I couldn't find one that easily. I took bits and pieces from a bunch of different ones and put them all together and eventually got up-and-running. I'm thinking of working on a screencast series about starting with Ruby on Rails, but haven't started yet.

Hope that helps, and I think you'll love Ruby once you get the hang of it. :) I noticed a lot of similarities with CakePHP...

- Alex

cancer10
11-27-2010, 04:48 AM
So if I want to use as a web programming language, is there a different approach for that?

X96 Web Design
11-27-2010, 04:53 AM
Not really, no... For web programming, you just install Rails (add-on to Ruby) and configure your web server (Apache, NGiNX, etc.) to route requests through Ruby on Rails' webserver.

You really only need the command line for one statement, the rest can be done by hand. It's just the initial configuration of the Ruby on Rails app that needs the terminal.

cancer10
11-27-2010, 04:56 AM
Just for my knowledge, what are gems are what is it used for?

X96 Web Design
11-27-2010, 04:58 AM
Gems is a command-line interface for installing add-ons to Ruby. For example, Rails is installed through Gems, as well as MySQL, and a host of other stuff.

The syntax is like:

gem install rails
Where 'rails' is the add-on you're attempting to install.

cancer10
11-27-2010, 03:39 PM
Great.

Whats the deployment process of a Ruby on Rails application on the webserver?

In CakePHP, we used to upload all the folders and files of the framework along with our application.

Thanks

X96 Web Design
11-27-2010, 04:12 PM
I haven't done much deployment, mostly just local development, so don't take my word on any of this... ;)

From what I've read, I think it's based around Git repositories. It's all build into Ruby, so you can just clone your local source code to your server... That seems to be the easiest way. Otherwise manually uploading the models, views, controllers, layouts, database data etc. is the other option.

Cheers,
Alex

cancer10
11-28-2010, 05:49 AM
Hi

Do you know how to have Ruby work on apache instead of Webrick?


THanks

X96 Web Design
11-28-2010, 05:56 AM
The way it works is you install an Apache mod called Passenger and that tells Apache to route requests through Webrick.

- Alex

cancer10
11-28-2010, 06:18 AM
No, I meant, I do not want to use/install webrick but apache for my ruby applications.

X96 Web Design
11-28-2010, 07:21 AM
You can still use Apache, it just uses Webrick as an interpreter to translate the Ruby code into something it can understand. I don't know if it's possible to not use Webrick...