Help needed with Ruby on Rails

J

jl_post

Dear Ruby community,

I need some help (hopefully just a little) installing and using Ruby
on Rails. I'm fairly new to both Ruby and Rails, so I am following the
steps mentioned in the book "Agile Web Development with Rails" (by Dave
Thomas and David Heinemeier Hansson).

Currently, I am going through the steps of "Chapter 4: Instant
Gratification". I got to the point where I type "ruby script/server",
then connect to http://mylocalsite.local.net:3000/ and then see a nice
"Congratulations, you've put Ruby on Rails!" welcome message.

So far so good. In fact, On the WEBrick server side, I can see
these four lines when I try to visit that page (using a web browser):

192.168.1.222 - - [16/Nov/2005:15:38:11 MST] "GET / HTTP/1.1" 304 0
- -> /
192.168.1.222 - - [16/Nov/2005:15:38:11 MST] "GET /favicon.ico
HTTP/1.1" 304 0
- -> /favicon.ico

Okay, so now I run the command "ruby script/generate controller Say"
from the command line to create a controller called "say" (just like
the example in the book). It seems to work correctly -- that is, the
directory structure appears to be there as well as the
app/controllers/say_controller.rb file. I even edited the
SayController class to be:

class SayController < ApplicationController
def hello
end
end

Here's where things go wrong:

When I try to visit http://mylocalsite.local.net:3000/say/hello I
get a blank screen on my web browser. I get no error message or
anything. According to the book, I should see a "Template is missing"
error message, but instead I see nothing at all. (This even happens if
I stop and restart the WEBrick server.)

I even tried creating the file app/views/say/hello.rhtml (that all
it says is "Hello from Rails!") but when I reload the page, I still get
nothing. I should at least get an error message, right?

So now I'm not sure what to do. So far I've installed Rails two
times (to make sure I didn't miss a step) but I still get the same
error. In case anyone's interested, my version of Ruby is 1.8.2 and my
version of rubygems is 0.8.11 (running on Debian Linux).

I captured the output of the WEBrick server in case anyone wants to
see it. First a connection is make to
http://mylocalsite.local.net:3000/ is made (where everything looks
fine) and then a connection to
http://mylocalsite.local.net:3000/say/hello is made (where the entire
page is blank).

It looks like I'm missing a source file of some sort, but which one?
Did I not install gem correctly? Did I not use gem to install Rails
correctly? I'm not sure how to read the error output of the server to
figure out how to correct my problem.

Any help would be appreciated. I tried to give as much information
as I thought would help, but if some is missing, let me know and I'll
try to post it.

Thank you very much for any help. (Output of WEBrick server
follows.)

-- Jean-Luc



[2005-11-16 15:38:05] INFO WEBrick 1.3.1
[2005-11-16 15:38:05] INFO ruby 1.8.2 (2005-04-11) [i386-linux]
[2005-11-16 15:38:05] INFO WEBrick::HTTPServer#start: pid=1311
port=3000
192.168.1.222 - - [16/Nov/2005:15:38:11 MST] "GET / HTTP/1.1" 304 0
- -> /
192.168.1.222 - - [16/Nov/2005:15:38:11 MST] "GET /favicon.ico
HTTP/1.1" 304 0
- -> /favicon.ico
192.168.1.222 - - [16/Nov/2005:15:38:18 MST] "GET /say/hello HTTP/1.1"
200 0
- -> /say/hello
[2005-11-16 15:38:19] ERROR MissingSourceFile: no such file to load --
irb
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:in
`require'
/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/breakpoint.rb:18

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:in
`load'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:in
`load'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:39:in
`require_or_load'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:22:in
`depend_on'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:in
`require_dependency'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:in
`require_dependency'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:194:in
`const_missing'

/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb:76:in
`reset_after_dispatch'

/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb:46:in
`dispatch'

/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:117:in
`handle_dispatch'

/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:83:in
`service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:172:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:161:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:161:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'

/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:69:in
`dispatch'

/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/servers/webrick.rb:59
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:in
`require'

/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/server.rb:28
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:in
`require'
script/server:3
192.168.1.222 - - [16/Nov/2005:15:38:19 MST] "GET /favicon.ico
HTTP/1.1" 304 0
- -> /favicon.ico
 
J

James Britt

Dear Ruby community,

I need some help (hopefully just a little) installing and using Ruby
on Rails. I'm fairly new to both Ruby and Rails, so I am following the
steps mentioned in the book "Agile Web Development with Rails" (by Dave
Thomas and David Heinemeier Hansson).

You will probably get better, faster help at

http://lists.rubyonrails.org/mailman/listinfo



James

--

http://www.ruby-doc.org - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
http://www.30secondrule.com - Building Better Tools
 
J

jl_post

I need some help (hopefully just a little) installing and using Ruby
on Rails. I'm fairly new to both Ruby and Rails, so I am following the
steps mentioned in the book "Agile Web Development with Rails" (by Dave
Thomas and David Heinemeier Hansson).


Thanks for everyone who looked into this, but we recently figured
out how to get past this obstacle. Apparently the irb module wasn't
installed on our Debian machine (but ruby was).

We were able to see the irb modules to install with the command:

apt-cache search irb

and install the latest one with the command:

apt-get install irb1.8

Then, once the WEBrick server was restarted, we were able to get the
example in the book ("Agile Web Development with Rails") working.

Thanks again to everyone who tried to help.

-- Jean-Luc
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top