Ruby Beginner Need Help..

D

Didin Ibnu Sarnan

[Note: parts of this message were removed to make it a legal post.]

Hi,

I just installed ruby on my ubuntu, I use this following command to install
ruby:

# sudo apt-get install ruby1.9.1-full

After installation succeeded, I don't know what are the next step to begin
developing ruby, I from PHP language and I want to try to learn ruby.

oh ya, the command above as I know is installing ruby CLI like php CLI,
right?
or installing all environment like (php,apache) so I can beginning to learn
make some web application with ruby and I can debug with my browser.

Please put me right in this new experience :).


Thanks for all ruby gurus :)
 
S

Stu

Hello Didin ~

Look at rvm:

https://rvm.beginrescueend.com/

ruby has a package manager built in called gem

it also has it's own repl called irb.

to install rails use gem like so:

% gem install rails

to learn ruby interactivly use irb:

% irb=3D> "!dlroW ,olleH"

Hope this helps

~Stu
 
7

7stud --

Didin Ibnu Sarnan wrote in post #995669:
Hi,

I just installed ruby on my ubuntu, I use this following command to
install
ruby:

# sudo apt-get install ruby1.9.1-full

After installation succeeded, I don't know what are the next step to
begin
developing ruby, I from PHP language and I want to try to learn ruby.

You want to get a text editor that does automatic line indenting. Then
you create a new file, enter some ruby code, and save the file with a
rb extension. Then at the command line type:

ruby my_program.rb

and you will see any output your program produces.
 
D

Didin Ibnu Sarnan

[Note: parts of this message were removed to make it a legal post.]

Hi,

Thank you for all answer.

I have try execute ruby code with Command line and it was success.

What I want is, I want write ruby code and then display it in my browser
(firefox or whatever)

how can I do this?

Thank you :)
 
S

Stu

Ruby on Rails is a full stack web framework:

http://rubyonrails.org/

I believe that is what your looking for.

If you don't need a framework look at other projects like
http://www.sinatrarb.com/


Hi,

Thank you for all answer.

I have try execute ruby code with Command line and it was success.

What I want is, I want write ruby code and then display it in my browser
(firefox or whatever)

how can I do this?

Thank you :)
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

Hi,

Thank you for all answer.

I have try execute ruby code with Command line and it was success.

What I want is, I want write ruby code and then display it in my browser
(firefox or whatever)

how can I do this?

Thank you :)
I think that some PHP ideas don't translate directly to Ruby (I don't know
PHP, so this is just my impression). Ruby is a general purpose language, so
it is used for all sorts of things and isn't hooked up to the internet by
default (for example, most of the things I use Ruby for don't have anything
to do with web applications), and it isn't embedded in a template by default
either (PHP might not be, but that's just how I've always seen it).

-----

I think the easiest solution will be this:

$ gem install sinatra shotgun --no-ri --no-rdoc

(that will install the libraries locally, if that doesn't work, you will
need to either edit your path or use sudo)

Then create a file hw.rb that looks like this:

require 'sinatra'
get '/' do
"hello, world!"
end

That uses the sinatra web micro-framework to create a web application.

Then, run that application with $ shotgun hw.rb

Sinatra will know how to serve itself up, and shotgun will know how to
reload the file every time you make a request, this allows you to save your
document and reload your page without having to stop and start your server.

Finally, go to (http://localhost:9393/) in your browser. If everything is
working correctly, it will say "hello world"

-----

From there, check out (http://www.sinatrarb.com/intro.html) which will help
you make Sinatra do interesting things for you. I also recommend this great
screencast (http://peepcode.com/products/sinatra), where they'll walk
through a lot of the features and write an application with a database back
end.

You'll need to learn the Ruby language as well, though. I'm not sure what
people consider good resources for that, you'll have to ask around. If
you're comfortable with programming, you could take a look at Ruby
Kickstart, a curriculum I wrote to teach my friends Ruby (
https://github.com/JoshCheek/ruby-kickstart).

Once you are comfortable with all of that, you should be primed for Ruby on
Rails, :) If that is where you're wanting to head, then I recommend
http://guides.rubyonrails.org/ as the best resource I've seen for learning
Rails.

Anyway, welcome to Ruby :)
 
J

Justin Collins

This depends on how comfortable you are with setting up Apache and what
direction you want to go in.

If you are very comfortable with Apache, then install mod_ruby and you
can make pages using <% ruby_code_here %> (instead of <? php_code_here
?>). This is, however, considered a rather antiquated way of developing
web applications (but do it anyway if that is how you want to get started).

If you are thinking of writing full-fledged web applications, then you
may wish to try one of the many web frameworks suggested in other replies.

-Justin
 
D

Didin Ibnu Sarnan

[Note: parts of this message were removed to make it a legal post.]

Thank you for precious answer, I feel increased in my knowledge :).

so, I get that ruby is different with PHP,
as we know PHP is more inclined to web development purpose, but ruby is
general purpose not inclined to web, but can be used to webdevelopment with
add some application (rubyonrails or sinatra or etc), is it what I say
right?

firstly, I think that rubyonrails is similiar with Zend framework (one of
PHP framework).

Thanks for all :), maybe I will try use rubyonrails
 
S

Stu

To install rails you will need sqlite3 installed( though you can use
any db supported it's just default)

Here is a console walk through to get you started. First a summer of
commands used:

-> % history

1 gem install rails
2 rehash
3 rails new my_web_app
4 cd my_web_app
5 bundle install
6 rails server

(1) I install the rails gem. (2) I rehash for zsh. (3) I create my new
application template with the rails new generator. (4) I change to my
new application's directory. (5) run the bundler command to find any
gems that may be not installed (i.e. sqlite3). (6) start the server.

from there you can open your browser and see the welcome screen at
http://0.0.0.0:3000 or localhost:3000

Further instructions can be found at the Rails guide link on that page.

Here is a more verbose output from my console:

-> % gem install rails
Fetching: activesupport-3.0.7.gem (100%)
Fetching: builder-2.1.2.gem (100%)
WARNING: builder-2.1.2 has an invalid nil value for @cert_chain
Fetching: i18n-0.5.0.gem (100%)
Fetching: activemodel-3.0.7.gem (100%)
Fetching: rack-test-0.5.7.gem (100%)
Fetching: rack-mount-0.6.14.gem (100%)
Fetching: tzinfo-0.3.27.gem (100%)
Fetching: abstract-1.0.0.gem (100%)
WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain
Fetching: erubis-2.6.6.gem (100%)
Fetching: actionpack-3.0.7.gem (100%)
Fetching: arel-2.0.9.gem (100%)
Fetching: activerecord-3.0.7.gem (100%)
Fetching: activeresource-3.0.7.gem (100%)
Fetching: mime-types-1.16.gem (100%)
Fetching: polyglot-0.3.1.gem (100%)
Fetching: treetop-1.4.9.gem (100%)
Fetching: mail-2.2.19.gem (100%)
Fetching: actionmailer-3.0.7.gem (100%)
Fetching: thor-0.14.6.gem (100%)
Fetching: railties-3.0.7.gem (100%)
Fetching: bundler-1.0.12.gem (100%)
Fetching: rails-3.0.7.gem (100%)
Successfully installed activesupport-3.0.7
Successfully installed builder-2.1.2
Successfully installed i18n-0.5.0
Successfully installed activemodel-3.0.7
Successfully installed rack-test-0.5.7
Successfully installed rack-mount-0.6.14
Successfully installed tzinfo-0.3.27
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.7
Successfully installed arel-2.0.9
Successfully installed activerecord-3.0.7
Successfully installed activeresource-3.0.7
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.9
Successfully installed mail-2.2.19
Successfully installed actionmailer-3.0.7
Successfully installed thor-0.14.6
Successfully installed railties-3.0.7
Successfully installed bundler-1.0.12
Successfully installed rails-3.0.7
22 gems installed
Installing ri documentation for activesupport-3.0.7...
Installing ri documentation for builder-2.1.2...
Installing ri documentation for i18n-0.5.0...
Installing ri documentation for activemodel-3.0.7...
Installing ri documentation for rack-test-0.5.7...
Installing ri documentation for rack-mount-0.6.14...
Installing ri documentation for tzinfo-0.3.27...
Installing ri documentation for abstract-1.0.0...
Installing ri documentation for erubis-2.6.6...
Installing ri documentation for actionpack-3.0.7...
Installing ri documentation for arel-2.0.9...
Installing ri documentation for activerecord-3.0.7...
Installing ri documentation for activeresource-3.0.7...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for polyglot-0.3.1...
Installing ri documentation for treetop-1.4.9...
Installing ri documentation for mail-2.2.19...
Installing ri documentation for actionmailer-3.0.7...
Installing ri documentation for thor-0.14.6...
Installing ri documentation for railties-3.0.7...
Installing ri documentation for bundler-1.0.12...
Installing ri documentation for rails-3.0.7...
Installing RDoc documentation for activesupport-3.0.7...
Installing RDoc documentation for builder-2.1.2...
Installing RDoc documentation for i18n-0.5.0...
Installing RDoc documentation for activemodel-3.0.7...
Installing RDoc documentation for rack-test-0.5.7...
Installing RDoc documentation for rack-mount-0.6.14...
Installing RDoc documentation for tzinfo-0.3.27...
Installing RDoc documentation for abstract-1.0.0...
Installing RDoc documentation for erubis-2.6.6...
Installing RDoc documentation for actionpack-3.0.7...
Installing RDoc documentation for arel-2.0.9...
Installing RDoc documentation for activerecord-3.0.7...
Installing RDoc documentation for activeresource-3.0.7...
Installing RDoc documentation for mime-types-1.16...
Installing RDoc documentation for polyglot-0.3.1...
Installing RDoc documentation for treetop-1.4.9...
Installing RDoc documentation for mail-2.2.19...
Installing RDoc documentation for actionmailer-3.0.7...
Installing RDoc documentation for thor-0.14.6...
Installing RDoc documentation for railties-3.0.7...
Installing RDoc documentation for bundler-1.0.12...
Installing RDoc documentation for rails-3.0.7...

-> % rehash

-> % rails new my_web_app
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create log
create log/server.log
create log/production.log
create log/development.log
create log/test.log
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create public/images
create public/images/rails.png
create public/stylesheets
create public/stylesheets/.gitkeep
create public/javascripts
create public/javascripts/application.js
create public/javascripts/controls.js
create public/javascripts/dragdrop.js
create public/javascripts/effects.js
create public/javascripts/prototype.js
create public/javascripts/rails.js
create script
create script/rails
create test
create test/fixtures
create test/functional
create test/integration
create test/performance/browsing_test.rb
create test/test_helper.rb
create test/unit
create tmp
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create vendor/plugins
create vendor/plugins/.gitkeep

-> % cd my_web_app

-> % bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.7)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.7)
Using erubis (2.6.6)
Using rack (1.2.2)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.27)
Using actionpack (3.0.7)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.19)
Using actionmailer (3.0.7)
Using arel (2.0.9)
Using activerecord (3.0.7)
Using activeresource (3.0.7)
Using bundler (1.0.12)
Using thor (0.14.6)
Using railties (3.0.7)
Using rails (3.0.7)
Installing sqlite3 (1.3.3) with native extensions
Your bundle is complete! Use `bundle show [gemname]` to see where a
bundled gem is installed.

-> % rails server
=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-04-28 23:34:37] INFO WEBrick 1.3.1
[2011-04-28 23:34:37] INFO ruby 1.9.2 (2011-02-18) [x86_64-linux]
[2011-04-28 23:34:37] INFO WEBrick::HTTPServer#start: pid=3186 port=3000


Started GET "/rails/info/properties" for 127.0.0.1 at 2011-04-28 23:34:55 -0500
Processing by Rails::InfoController#properties as HTML
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'

Rendered inline template (0.3ms)
Completed 200 OK in 19ms (Views: 0.8ms | ActiveRecord: 0.3ms)
^C[2011-04-28 23:35:00] INFO going to shutdown ...
[2011-04-28 23:35:00] INFO WEBrick::HTTPServer#start done.
Exiting
-> %
 
D

Didin Ibnu Sarnan

[Note: parts of this message were removed to make it a legal post.]

Over all I have succedeed install rails on my laptop, when I do
# rails server

itis was failed and produce this error:

Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your

after that I try to install sqllite3
with sudo apt-get install sqlite3 and installed,

I try to restart server rails, but it doesn't change and keep in producing
this error.
so I try to do

# sudo gem install sqlite3
but it was error:

Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.


Anyone, can help me?

Thank you :)


2011/4/29 Stu said:
To install rails you will need sqlite3 installed( though you can use
any db supported it's just default)

Here is a console walk through to get you started. First a summer of
commands used:

-> % history

1 gem install rails
2 rehash
3 rails new my_web_app
4 cd my_web_app
5 bundle install
6 rails server

(1) I install the rails gem. (2) I rehash for zsh. (3) I create my new
application template with the rails new generator. (4) I change to my
new application's directory. (5) run the bundler command to find any
gems that may be not installed (i.e. sqlite3). (6) start the server.

from there you can open your browser and see the welcome screen at
http://0.0.0.0:3000 or localhost:3000

Further instructions can be found at the Rails guide link on that page.

Here is a more verbose output from my console:

-> % gem install rails
Fetching: activesupport-3.0.7.gem (100%)
Fetching: builder-2.1.2.gem (100%)
WARNING: builder-2.1.2 has an invalid nil value for @cert_chain
Fetching: i18n-0.5.0.gem (100%)
Fetching: activemodel-3.0.7.gem (100%)
Fetching: rack-test-0.5.7.gem (100%)
Fetching: rack-mount-0.6.14.gem (100%)
Fetching: tzinfo-0.3.27.gem (100%)
Fetching: abstract-1.0.0.gem (100%)
WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain
Fetching: erubis-2.6.6.gem (100%)
Fetching: actionpack-3.0.7.gem (100%)
Fetching: arel-2.0.9.gem (100%)
Fetching: activerecord-3.0.7.gem (100%)
Fetching: activeresource-3.0.7.gem (100%)
Fetching: mime-types-1.16.gem (100%)
Fetching: polyglot-0.3.1.gem (100%)
Fetching: treetop-1.4.9.gem (100%)
Fetching: mail-2.2.19.gem (100%)
Fetching: actionmailer-3.0.7.gem (100%)
Fetching: thor-0.14.6.gem (100%)
Fetching: railties-3.0.7.gem (100%)
Fetching: bundler-1.0.12.gem (100%)
Fetching: rails-3.0.7.gem (100%)
Successfully installed activesupport-3.0.7
Successfully installed builder-2.1.2
Successfully installed i18n-0.5.0
Successfully installed activemodel-3.0.7
Successfully installed rack-test-0.5.7
Successfully installed rack-mount-0.6.14
Successfully installed tzinfo-0.3.27
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.7
Successfully installed arel-2.0.9
Successfully installed activerecord-3.0.7
Successfully installed activeresource-3.0.7
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.9
Successfully installed mail-2.2.19
Successfully installed actionmailer-3.0.7
Successfully installed thor-0.14.6
Successfully installed railties-3.0.7
Successfully installed bundler-1.0.12
Successfully installed rails-3.0.7
22 gems installed
Installing ri documentation for activesupport-3.0.7...
Installing ri documentation for builder-2.1.2...
Installing ri documentation for i18n-0.5.0...
Installing ri documentation for activemodel-3.0.7...
Installing ri documentation for rack-test-0.5.7...
Installing ri documentation for rack-mount-0.6.14...
Installing ri documentation for tzinfo-0.3.27...
Installing ri documentation for abstract-1.0.0...
Installing ri documentation for erubis-2.6.6...
Installing ri documentation for actionpack-3.0.7...
Installing ri documentation for arel-2.0.9...
Installing ri documentation for activerecord-3.0.7...
Installing ri documentation for activeresource-3.0.7...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for polyglot-0.3.1...
Installing ri documentation for treetop-1.4.9...
Installing ri documentation for mail-2.2.19...
Installing ri documentation for actionmailer-3.0.7...
Installing ri documentation for thor-0.14.6...
Installing ri documentation for railties-3.0.7...
Installing ri documentation for bundler-1.0.12...
Installing ri documentation for rails-3.0.7...
Installing RDoc documentation for activesupport-3.0.7...
Installing RDoc documentation for builder-2.1.2...
Installing RDoc documentation for i18n-0.5.0...
Installing RDoc documentation for activemodel-3.0.7...
Installing RDoc documentation for rack-test-0.5.7...
Installing RDoc documentation for rack-mount-0.6.14...
Installing RDoc documentation for tzinfo-0.3.27...
Installing RDoc documentation for abstract-1.0.0...
Installing RDoc documentation for erubis-2.6.6...
Installing RDoc documentation for actionpack-3.0.7...
Installing RDoc documentation for arel-2.0.9...
Installing RDoc documentation for activerecord-3.0.7...
Installing RDoc documentation for activeresource-3.0.7...
Installing RDoc documentation for mime-types-1.16...
Installing RDoc documentation for polyglot-0.3.1...
Installing RDoc documentation for treetop-1.4.9...
Installing RDoc documentation for mail-2.2.19...
Installing RDoc documentation for actionmailer-3.0.7...
Installing RDoc documentation for thor-0.14.6...
Installing RDoc documentation for railties-3.0.7...
Installing RDoc documentation for bundler-1.0.12...
Installing RDoc documentation for rails-3.0.7...

-> % rehash

-> % rails new my_web_app
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create log
create log/server.log
create log/production.log
create log/development.log
create log/test.log
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create public/images
create public/images/rails.png
create public/stylesheets
create public/stylesheets/.gitkeep
create public/javascripts
create public/javascripts/application.js
create public/javascripts/controls.js
create public/javascripts/dragdrop.js
create public/javascripts/effects.js
create public/javascripts/prototype.js
create public/javascripts/rails.js
create script
create script/rails
create test
create test/fixtures
create test/functional
create test/integration
create test/performance/browsing_test.rb
create test/test_helper.rb
create test/unit
create tmp
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create vendor/plugins
create vendor/plugins/.gitkeep

-> % cd my_web_app

-> % bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.7)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.7)
Using erubis (2.6.6)
Using rack (1.2.2)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.27)
Using actionpack (3.0.7)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.19)
Using actionmailer (3.0.7)
Using arel (2.0.9)
Using activerecord (3.0.7)
Using activeresource (3.0.7)
Using bundler (1.0.12)
Using thor (0.14.6)
Using railties (3.0.7)
Using rails (3.0.7)
Installing sqlite3 (1.3.3) with native extensions
Your bundle is complete! Use `bundle show [gemname]` to see where a
bundled gem is installed.

-> % rails server
=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-04-28 23:34:37] INFO WEBrick 1.3.1
[2011-04-28 23:34:37] INFO ruby 1.9.2 (2011-02-18) [x86_64-linux]
[2011-04-28 23:34:37] INFO WEBrick::HTTPServer#start: pid=3186 port=3000


Started GET "/rails/info/properties" for 127.0.0.1 at 2011-04-28 23:34:55
-0500
Processing by Rails::InfoController#properties as HTML
SQL (0.3ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'

Rendered inline template (0.3ms)
Completed 200 OK in 19ms (Views: 0.8ms | ActiveRecord: 0.3ms)
^C[2011-04-28 23:35:00] INFO going to shutdown ...
[2011-04-28 23:35:00] INFO WEBrick::HTTPServer#start done.
Exiting
-> %
 
J

Justin Collins

Over all I have succedeed install rails on my laptop, when I do
# rails server

itis was failed and produce this error:

Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your
after that I try to install sqllite3
with sudo apt-get install sqlite3 and installed,

I try to restart server rails, but it doesn't change and keep in producing
this error.
so I try to do

# sudo gem install sqlite3
but it was error:

Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.


Anyone, can help me?

Thank you :)

You need to install the sqlite3-dev package via apt-get, then try
installing the gem again.

-Justin
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

You need to install the sqlite3-dev package via apt-get, then try
installing the gem again.

-Justin

I seem to recall that Rails didn't work with 1.9.1
 
7

7stud --

Didin Ibnu Sarnan wrote in post #995698:
Thank you for precious answer, I feel increased in my knowledge :).

so, I get that ruby is different with PHP,
as we know PHP is more inclined to web development purpose, but ruby is
general purpose not inclined to web, but can be used to webdevelopment
with
add some application (rubyonrails or sinatra or etc), is it what I say
right?

Yes. Josh Cheek described the difference between php and ruby
accurately.

firstly, I think that rubyonrails is similiar with Zend framework (one
of
PHP framework).

Yes, that's correct.

Some more information: just like with php, you don't need to use a
bloated "framework" to use ruby on "the server side"(=for web pages).
Ruby can use the "cgi gateway" that your server probably provides. In
fact, it is probably a good excercise to write at least one ruby cgi
program just to see how it works. Here is a tutorial:

http://www.tutorialspoint.com/ruby/ruby_web_applications.htm
 
D

Didin Ibnu Sarnan

Thanks Josh, Justin and 7stud :)
Rails installed fine now, I use ruby 1.8,

7stud. That link very useful ;-)

Thank you,

Didin
 
7

7stud --

I would use ruby 1.9.2. There are enough differences that you should
learn the latest ruby.
 
J

James Nathan

just seed me a disk so that I can upload it on my computer?=0A=0A=0A=0A____=
____________________________=0AFrom: Justin Collins <[email protected]=
=0ATo: ruby-talk ML <[email protected]>=0ASent: Thursday, April 28, =
2011 10:15 PM=0ASubject: Re: Ruby Beginner Need Help..=0A=0A=0A> 2011/4/29 =
995669:=0A>>> Hi,=0A>>>=0A>>> I just installed ruby on my ubuntu, I use thi=
s following command to=0A>>> install=0A>>> ruby:=0A>>>=0A>>> # sudo apt-get=
install ruby1.9.1-full=0A>>>=0A>>> After installation succeeded, I don't k=
now what are the next step to=0A>>> begin=0A>>> developing ruby, I from PHP=
language and I want to try to learn ruby.=0A>>>=0A>> You want to get a tex=
t editor that does automatic line indenting.=A0 Then=0A>> you create a new =
file, enter some ruby code, and save the file with a=0A>> .rb extension.=A0=
Then at the command line type:=0A>>=0A>> ruby my_program.rb=0A>>=0A>> and =
you will see any output your program produces.=0A>>=0A>> --=0A>> Posted via=
http://www.ruby-forum.com/.=0A>>=0A>>=0A>> On 04/28/2011 08:17 PM, Didin I=
bnu Sarnan wrote:=0A>>> Hi,=0A>>>=0A>>> Thank you for all answer.=0A>>>=0A>==0A>>> What I want is, I want write ruby code and then display it in my bro=
wser=0A>>> (firefox or whatever)=0A>>>=0A>>> how can I do this?=0A>>>=0A>>>=
Thank you :)=0A=0AThis depends on how comfortable you are with setting up =
Apache and what =0Adirection you want to go in.=0A=0AIf you are very comfor=
table with Apache, then install mod_ruby and you =0Acan make pages using <%=
ruby_code_here %> (instead of <? php_code_here =0A?>). This is, however, c=
onsidered a rather antiquated way of developing =0Aweb applications (but do=
it anyway if that is how you want to get started).=0A=0AIf you are thinkin=
g of writing full-fledged web applications, then you =0Amay wish to try one=
of the many web frameworks suggested in other replies.=0A=0A-Justin
 
J

James Nathan

like I said just send me the disk, the up load is not working.=0A=0A=0A=0A_=
_______________________________=0AFrom: James Nathan <[email protected]=
om>=0ATo: ruby-talk ML <[email protected]>=0ASent: Sunday, May 1, 201=
1 10:24 PM=0ASubject: Re: Ruby Beginner Need Help..=0A=0Ajust seed me a dis=
k so that I can upload it on my computer?=0A=0A=0A=0A______________________=
__________=0AFrom: Justin Collins <[email protected]>=0ATo: ruby-talk =
ML <[email protected]>=0ASent: Thursday, April 28, 2011 10:15 PM=0ASu=
bject: Re: Ruby Beginner Need Help..=0A=0A=0A> 2011/4/29 7stud --<bbxx789_0=
(e-mail address removed)>=0A>=0A>> Didin Ibnu Sarnan wrote in post #995669:=0A>>> Hi,=
=0A>>>=0A>>> I just installed ruby on my ubuntu, I use this following comma=
nd to=0A>>> install=0A>>> ruby:=0A>>>=0A>>> # sudo apt-get install ruby1.9.=
1-full=0A>>>=0A>>> After installation succeeded, I don't know what are the =
next step to=0A>>> begin=0A>>> developing ruby, I from PHP language and I w=
ant to try to learn ruby.=0A>>>=0A>> You want to get a text editor that doe=
s automatic line indenting.=A0 Then=0A>> you create a new file, enter some =
ruby code, and save the file with a=0A>> .rb extension.=A0 Then at the comm=
and line type:=0A>>=0A>> ruby my_program.rb=0A>>=0A>> and you will see any =
output your program produces.=0A>>=0A>> --=0A>> Posted via http://www.ruby-=
forum.com/.=0A>>=0A>>=0A>> On 04/28/2011 08:17 PM, Didin Ibnu Sarnan wrote:=
=0A>>> Hi,=0A>>>=0A>>> Thank you for all answer.=0A>>>=0A>>> I have try exe=
cute ruby code with Command line and it was success.=0A>>>=0A>>> What I wan=
t is, I want write ruby code and then display it in my browser=0A>>> (firef=
ox or whatever)=0A>>>=0A>>> how can I do this?=0A>>>=0A>>> Thank you :)=0A=
=0AThis depends on how comfortable you are with setting up Apache and what =
=0Adirection you want to go in.=0A=0AIf you are very comfortable with Apach=
e, then install mod_ruby and you =0Acan make pages using <% ruby_code_here =
%> (instead of <? php_code_here =0A?>). This is, however, considered a rath=
er antiquated way of developing =0Aweb applications (but do it anyway if th=
at is how you want to get started).=0A=0AIf you are thinking of writing ful=
l-fledged web applications, then you =0Amay wish to try one of the many web=
frameworks suggested in other replies.=0A=0A-Justin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top