# Problem with "Hello World Program"

**URL:** <https://www.ruby-forum.com/t/problem-with-hello-world-program/158438>\
**Category:** Rails\
**Created:** [January 23, 2009, 12:13pm UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438 "2009-01-23T12:13:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![agrinshtein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@agrinshtein](https://www.ruby-forum.com/u/agrinshtein)\
**Post date:** [January 23, 2009, 12:13pm UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438/1 "2009-01-23T12:13:23Z")

</div>

Hey I am new to RoR. I used Dan Benjamins install. Installing MySQL  
and RoR using the terminal.

I made two files. One the controller, called say\_controller and than  
I made a views file, called hello.html.erb

Instead of getting “Hello, world!” I get

SyntaxError in SayController#hello

/Users/arongrinshtein/agile/demo/app/controllers/say\_controller.rb:3:  
syntax error, unexpected $end, expecting kEND

Any ideas?

I am keen to get coding.

Thanks!

---

<div class="post-metadata">

**Author:** ![agrinshtein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@agrinshtein](https://www.ruby-forum.com/u/agrinshtein)\
**Post date:** [January 23, 2009, 12:14pm UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438/2 "2009-01-23T12:14:35Z")

</div>

On Jan 23, 10:06 am, agrinshtein [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Instead of getting “Hello, world!” I get
> 
> SyntaxError in SayController#hello
> 
> /Users/arongrinshtein/agile/demo/app/controllers/say\_controller.rb:3:  
> syntax error, unexpected $end, expecting kEND
> 
> Any ideas?

It probably is just a syntax error like a stray or missing ‘end’. Hard  
to say without seeing the controller code though.

Fred

---

<div class="post-metadata">

**Author:** ![agrinshtein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@agrinshtein](https://www.ruby-forum.com/u/agrinshtein)\
**Post date:** [January 23, 2009, 2:20pm UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438/3 "2009-01-23T14:20:33Z")

</div>

Here is the controller code.

class SayController \< ApplicationController  
def hello  
end

I just copied and pasted from “Agile Web development with rails.”

On Jan 23, 1:13 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![agrinshtein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@agrinshtein](https://www.ruby-forum.com/u/agrinshtein)\
**Post date:** [January 23, 2009, 2:21pm UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438/4 "2009-01-23T14:21:09Z")

</div>

put another end after def hello

---

<div class="post-metadata">

**Author:** ![agrinshtein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@agrinshtein](https://www.ruby-forum.com/u/agrinshtein)\
**Post date:** [January 23, 2009, 3:11pm UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438/5 "2009-01-23T15:11:19Z")

</div>

you may not have the sqlite3 gem installed.

sudo gem install sqlite3-ruby

also make sure you run your migrations

rake db:migrate

then you should be good to go.

---

<div class="post-metadata">

**Author:** ![agrinshtein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@agrinshtein](https://www.ruby-forum.com/u/agrinshtein)\
**Post date:** [January 23, 2009, 4:23pm UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438/6 "2009-01-23T16:23:45Z")

</div>

THANKS GUYS!

It is working. The only thing is, is there any way to configure it  
with MySQL. Is there any reason to do that?

---

<div class="post-metadata">

**Author:** ![agrinshtein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@agrinshtein](https://www.ruby-forum.com/u/agrinshtein)\
**Post date:** [January 24, 2009, 12:28am UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438/7 "2009-01-24T00:28:05Z")

</div>

The default database for Rails apps was changed from Mysql to Sqlite.  
Thankfully, it’s quite easy to switch your DB:

If you are starting a Rails project from scratch, run your rails  
command like so:  
rails -d mysql myapp

If you want to switch an exisiting project from Sqlite to Mysql:  
set adapter to “mysql” in your config/database.yml file.

Hope to help,  
Jason Arora

---

<div class="post-metadata">

**Author:** ![agrinshtein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@agrinshtein](https://www.ruby-forum.com/u/agrinshtein)\
**Post date:** [January 23, 2009, 2:56pm UTC](https://www.ruby-forum.com/t/problem-with-hello-world-program/158438/8 "2009-01-23T14:56:33Z")

</div>

Did that. Now I get another error.

MissingSourceFile in SayController#hello

no such file to load – sqlite3

It is possible that is the case because I set RoR up with MySQL,  
following Dan Benjamins tutorials.  
[http://danbenjamin.com/articles/2008/02/ruby-rails-leopard](http://danbenjamin.com/articles/2008/02/ruby-rails-leopard)  
[http://danbenjamin.com/articles/2007/11/installing-mysql-on-mac-os-x](http://danbenjamin.com/articles/2007/11/installing-mysql-on-mac-os-x)

Any ideas how to connect it with MySQL or should I connect it with  
SQLite. Not that I know the difference.

Thanks for your help guys.
