ERb on he command line re: Ruby For Rails book

Hi,

I am working thru the Ruby for rails book. On page 30 David Black
talks about running erb from the command line i.e. $ erb erbdemo.rb
just as you would a normal ruby prog ($ ruby erbdemo.rb) but when I
try to do this I get command not found. How do I make this work? I am
running Linux (Ubuntu Breezy)

Regards,

Paul

Hi –

On Thu, 27 Apr 2006, Paul Jonathan T. wrote:

Hi,

I am working thru the Ruby for rails book. On page 30 David Black
talks about running erb from the command line i.e. $ erb erbdemo.rb
just as you would a normal ruby prog ($ ruby erbdemo.rb) but when I
try to do this I get command not found. How do I make this work? I am
running Linux (Ubuntu Breezy)

It might depend how you installed Ruby. Is it possible that Ubuntu
bundles erb separately in a different package?

David


David A. Black ([email protected])
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

“Ruby for Rails” PDF now on sale! http://www.manning.com/black
Paper version coming in early May!

for what it’s worth, I think Ezra Zyg. (he who does not sleep) was
building a Rails-specific Ubuntu called Rubuntu.


Giles B.
http://www.gilesgoatboy.org

David,

I am getting this when I attempt to run the code from CH 2 of your
book. Can you advise please?

Loading development environment.

class MainController < ApplicationController

?> def welcome

@composers = Composer.find(:all).sort_by {|c| [c.last_name,
c.first_name] }>> end

end
NameError: uninitialized constant ApplicationController
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in
`const_missing’
from (irb):1

Regards,

Paul

Hi –

On Fri, 28 Apr 2006, Paul Jonathan T. wrote:

c.first_name] }>> end

end
NameError: uninitialized constant ApplicationController
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in
`const_missing’
from (irb):1

I’m really not sure what could be behind that other than for some
reason the application_controller.rb file being missing on your
system, or maybe some kind of very obscure version mismatch in the
Rails setup. Is application_controller.rb there?

David

P.S. I’m in London at the moment and not as constantly online as I
usually am, but will be checking in at least periodically.

Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


David A. Black ([email protected])
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

“Ruby for Rails” PDF now on sale! http://www.manning.com/black
Paper version coming in early May!

Hi David,

Thank you for your efforts. I am in Auckland, New Zealand so we are a
180 deg out of sinc.

I sorted out the problem by starting the exercise again and things
came right. So it was most likely finger problems.

On a new context, if you can spare a moment I need to achieve the
following and I do not have much time to do it in (Unfortunately I
have only just discovered your book and I am working from the pdf
while I await the hard copy which I ordered on Friday).

I have two tables and they have a one to many relationship I want to
display the contents in a browser. Parent with its children beneath
it. How do I do this. I am a rails (and Ruby nuby, as you already
know) so am pretty ignorant. Sorry to be making such a nuisance of my
self.

Regards,

Paul

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs