# I am New to Ruby..Please Help me ON start

**URL:** <https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283>\
**Category:** Rails\
**Created:** [December 10, 2008, 5:44am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283 "2008-12-10T05:44:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 5:44am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/1 "2008-12-10T05:44:32Z")

</div>

Hello All…

I am new to ruby…

I have installed ruby 1.8.6 in my XP machine.

Installed by Ruby one-click installer. And then i have installed Apache2  
Webserver.

Then tried with a testProgram in Run-\> cmd → rails testProgram

Then i have completed ruby script/server on cmd

Then after that i took [http://127.0.0.1:3000/](http://127.0.0.1:3000/) in my browser and i got  
the default page.

It contains the details like

```
      "Welcome Abroad"
      About your application Environment with a link.

```

Once i click on that I got Like "MissingSourceFile in Rails/…

no such file to load – sqlite3

RAILS\_ROOT: C:/Ruby/testProgram

I need to use the mysql as database.

The mysql server is therre in another machine in my LAN. I dont know how  
to connect to that…

And also I am so srry to ask this simple doubt but im new to thias ruby.

I want to to knw how can i start by simply print or start with ruby page  
by a message “Welcome to RUBY”. Where can i start with? How??

Hope some one help me out

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 6:45am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/2 "2008-12-10T06:45:47Z")

</div>

hi

your rails app folder, go to config/database.yml

in datebase.yml

you will find like this

development:  
adapter: mysql  
database: test  
username: root  
password: password  
host: localhost  
socket: /var/run/mysqld/mysqld.sock

in host your that system ip like

adapter: mysql  
database: test  
username: root  
password: password  
host: 10.0.1.28  
socket: /var/run/mysqld/mysqld.sock

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 6:51am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/3 "2008-12-10T06:51:06Z")

</div>

Thanks for ur reply…

In database.yml i can find this

# SQLite version 3.x

# gem install sqlite3-ruby (not necessary on OS X Leopard)

development:  
adapter: sqlite3  
database: db/development.sqlite3  
pool: 5  
timeout: 5000

# Warning: The database defined as “test” will be erased and

# re-generated from your development database when you run “rake”.

# Do not set this db to the same as development or production.

test:  
adapter: sqlite3  
database: db/test.sqlite3  
pool: 5  
timeout: 5000

production:  
adapter: sqlite3  
database: db/production.sqlite3  
pool: 5  
timeout: 5000

I didnt install Mysql in my PC…

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 6:55am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/4 "2008-12-10T06:55:27Z")

</div>

If you will not use any database, you can cancel active\_record.  
Modify config/environment.rb  
Uncomment this line:

# config.frameworks -= [ :active\_record, :active\_resource,

:action\_mailer ]

On Wed, Dec 10, 2008 at 1:51 PM, Rohith Nair \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> pool: 5
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
TWRUG Blog:  
[http://blog.rubyonrails.org.tw](http://blog.rubyonrails.org.tw)

CFC on Rails:

> **[CFC on Rails](http://zusocfc.blogspot.com)**
>
> 火車請別撞我

Only two surfaces of a box:  
[http://blog.pixnet.net/zusocfc](http://blog.pixnet.net/zusocfc)

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:12am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/5 "2008-12-10T07:12:25Z")

</div>

err .. Did you generated any model yet?  
And SQLite is not same as MySQL, they are different.  
Run cmd and type: gem i sqlite3-ruby  
And comment config.frameworks -= [ :active\_record, :active\_resource,  
:action\_mailer ]  
And, restart your server and try again

On Wed, Dec 10, 2008 at 2:01 PM, Rohith Nair \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> # SQLite version 3.x
> 
> test:
> 
> ## Is all correct??
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
TWRUG Blog:  
[http://blog.rubyonrails.org.tw](http://blog.rubyonrails.org.tw)

CFC on Rails:

> **[CFC on Rails](http://zusocfc.blogspot.com)**
>
> 火車請別撞我

Only two surfaces of a box:  
[http://blog.pixnet.net/zusocfc](http://blog.pixnet.net/zusocfc)

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:01am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/6 "2008-12-10T07:01:00Z")

</div>

Thank you for the reply

Now i got message by clicking on the link ’ About your application  
Environment’ as

“uninitialized constant ActiveRecord::Base”

ok…And my databasse.yml is like this…

# SQLite version 3.x

# gem install sqlite3-ruby (not necessary on OS X Leopard)

development:  
adapter: sqlite3  
database: db/development.sqlite3  
pool: 5  
timeout: 5000

# Warning: The database defined as “test” will be erased and

# re-generated from your development database when you run “rake”.

# Do not set this db to the same as development or production.

test:  
adapter: sqlite3  
database: db/test.sqlite3  
pool: 5  
timeout: 5000

production:  
adapter: sqlite3  
database: db/production.sqlite3  
pool: 5  
timeout: 5000

Is all correct??

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:21am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/7 "2008-12-10T07:21:09Z")

</div>

Thanks Air…

How can i do that?? How can i replace as my database.yml??

And billy…

Wat u mean by generating model?

i didn’t do anything yet…

Just reached in the start up screen telling the message “Welcome abroad”

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:15am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/8 "2008-12-10T07:15:54Z")

</div>

no need mysql in your system.

you have to replace database.yml with my database.yml file.

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:28am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/9 "2008-12-10T07:28:13Z")

</div>

I think no need to change socket, just delete it 🙂

On Wed, Dec 10, 2008 at 2:25 PM, Air \*\*\*  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> ## development:
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
TWRUG Blog:  
[http://blog.rubyonrails.org.tw](http://blog.rubyonrails.org.tw)

CFC on Rails:

> **[CFC on Rails](http://zusocfc.blogspot.com)**
>
> 火車請別撞我

Only two surfaces of a box:  
[http://blog.pixnet.net/zusocfc](http://blog.pixnet.net/zusocfc)

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:29am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/10 "2008-12-10T07:29:17Z")

</div>

use this

Air \*\*\* wrote:

> Air \*\*\* wrote:
> 
> > no need mysql in your system.
> > 
> > you have to replace database.yml with my database.yml file.
> 
> Delete your database.yml. then copy my “database.yml” i was attached  
> bfter that  
> then change follow thinks
> 
> development:  
> adapter: mysql  
> database: test  
> username: root  
> password: password  
> host: localhost  
> socket: /var/run/mysqld/mysqld.sock
> 
> change socket to “socket = C:/www/tmp/mysql.sock”

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:25am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/11 "2008-12-10T07:25:08Z")

</div>

Air \*\*\* wrote:

> no need mysql in your system.
> 
> you have to replace database.yml with my database.yml file.

Delete your database.yml. then copy my “database.yml” i was attached  
after that  
then change follow thinks

development:  
adapter: mysql  
database: test  
username: root  
password: password  
host: localhost  
socket: /var/run/mysqld/mysqld.sock

change socket to “socket = C:/www/tmp/mysql.sock”

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:30am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/12 "2008-12-10T07:30:00Z")

</div>

he was using window xp

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:45am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/13 "2008-12-10T07:45:34Z")

</div>

ok… i never used windows for development. ubuntu or linux is good for  
development.

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:36am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/14 "2008-12-10T07:36:24Z")

</div>

I know.  
I never use socket parameter when I developed on Windows 😛

On Wed, Dec 10, 2008 at 2:30 PM, Air \*\*\*  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> ## he was using window xp
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
TWRUG Blog:  
[http://blog.rubyonrails.org.tw](http://blog.rubyonrails.org.tw)

CFC on Rails:

> **[CFC on Rails](http://zusocfc.blogspot.com)**
>
> 火車請別撞我

Only two surfaces of a box:  
[http://blog.pixnet.net/zusocfc](http://blog.pixnet.net/zusocfc)

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:49am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/15 "2008-12-10T07:49:13Z")

</div>

Thanks friends…

Now i used that database.yml that given.

And then i have started the cmd -\> ruby script/server

Then re started my browser. Then got the starting page…

Click on the link and and got the details…

This is the details

Ruby version 1.8.6 (i386-mswin32)  
RubyGems version 1.3.1  
Rails version 2.2.2  
Active Record version 2.2.2  
Action Pack version 2.2.2  
Active Resource version 2.2.2  
Action Mailer version 2.2.2  
Active Support version 2.2.2  
Application root C:/Ruby/TestOne  
Environment development  
Database adapter mysql  
Database schema version 0

I think it is all correct…I have used a database ame that aleready  
exist in mysql

Is it all correct?? Then What is to do next? I mean i dnt knw how can i  
program on this ruby…initial simple program and need to knw wethr it is  
actually connected to the DB…Means shall i take any data from the Db  
in order to confirm??

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:55am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/16 "2008-12-10T07:55:31Z")

</div>

And again…

I have created another controller by taking CMD → ruby script/generate  
controller test

Then i edit the test\_controller under app/controller

class TestController \< ApplicationController  
def index  
render\_text “Test The Message”  
end  
end

But once i test it with [http://127.0.0.1:3000/test/](http://127.0.0.1:3000/test/)

I got an error message :

NoMethodError in TestController#index  
undefined method `render\_text’ for #TestController:0x465f078  
RAILS\_ROOT: C:/Ruby/TestOne

app/controllers/test\_controller.rb:3:in `index’

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 7:49am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/17 "2008-12-10T07:49:55Z")

</div>

My Database is under Linux machine

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 8:06am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/18 "2008-12-10T08:06:11Z")

</div>

better go through this “[http://fairleads.blogspot.com/](http://fairleads.blogspot.com/)”. it is more  
basic thinks

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 8:10am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/19 "2008-12-10T08:10:53Z")

</div>

Thanks for that… Can u help me out with some more links???

---

<div class="post-metadata">

**Author:** ![rohith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@rohith](https://www.ruby-forum.com/u/rohith)\
**Post date:** [December 10, 2008, 8:28am UTC](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283/20 "2008-12-10T08:28:21Z")

</div>

Thanks for that tooo

Now i did one cmd command

“rake db:create:all”

Its shows like Only modify the local one. U cant do the current database  
remoteHost

[Next page](https://www.ruby-forum.com/t/i-am-new-to-ruby-please-help-me-on-start/155283.md?page=2)
