# ERb on he command line re: Ruby For Rails book

**URL:** <https://www.ruby-forum.com/t/erb-on-he-command-line-re-ruby-for-rails-book/58918>\
**Category:** Rails\
**Created:** [April 27, 2006, 5:07am UTC](https://www.ruby-forum.com/t/erb-on-he-command-line-re-ruby-for-rails-book/58918 "2006-04-27T05:07:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [April 27, 2006, 5:07am UTC](https://www.ruby-forum.com/t/erb-on-he-command-line-re-ruby-for-rails-book/58918/1 "2006-04-27T05:07:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [April 27, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/erb-on-he-command-line-re-ruby-for-rails-book/58918/2 "2006-04-27T14:44:08Z")

</div>

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 (removed\_email\_address@domain.invalid)  
Ruby Power and Light, LLC ([http://www.rubypowerandlight.com](http://www.rubypowerandlight.com))

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

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [April 27, 2006, 7:30pm UTC](https://www.ruby-forum.com/t/erb-on-he-command-line-re-ruby-for-rails-book/58918/3 "2006-04-27T19:30:07Z")

</div>

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](http://www.gilesgoatboy.org)

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [April 28, 2006, 2:17am UTC](https://www.ruby-forum.com/t/erb-on-he-command-line-re-ruby-for-rails-book/58918/4 "2006-04-28T02:17:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [April 28, 2006, 9:20pm UTC](https://www.ruby-forum.com/t/erb-on-he-command-line-re-ruby-for-rails-book/58918/5 "2006-04-28T21:20:07Z")

</div>

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  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
David A. Black (removed\_email\_address@domain.invalid)  
Ruby Power and Light, LLC ([http://www.rubypowerandlight.com](http://www.rubypowerandlight.com))

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

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [May 3, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/erb-on-he-command-line-re-ruby-for-rails-book/58918/6 "2006-05-03T19:10:46Z")

</div>

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
