# Webby, Gems and Paths

**URL:** <https://www.ruby-forum.com/t/webby-gems-and-paths/128089>\
**Category:** Ruby\
**Created:** [February 4, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/webby-gems-and-paths/128089 "2008-02-04T22:44:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [February 4, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/webby-gems-and-paths/128089/1 "2008-02-04T22:44:13Z")

</div>

I am running an Ubuntu box, and it seems that whenever I “gem install”  
something  
with an executable (eg. /var/lib/gems/1.8/gems/webby-0.7.2/bin/webby)

- I have to  
make a link to it in /usr/local and set the +x flag before it works.  
With Webby, linking  
still doesn’t work because it tries to load libraries with relative  
paths:

/usr/local/bin/webby:4:in `require’: no such file to load –  
/usr/local/lib/webby (LoadError)

…so I have to cd to /var/lib/gems…etc. to run it.

Is there something wrong with my gems setup? Also, once I had build my  
Webby site,  
I had to put “require ‘rubygems’” in tasks/setup.rb before anything  
would work.

After that Webby seems to work very well, except for one more thing  
that I cannot  
resolve. When I try to create a new page:

lesliev@lesliev-laptop:/media/Storage/linux/qbe$ rake create:page about  
–trace  
(in /media/Storage/linux/qbe)  
\*\* Invoke create:page (first\_time)  
\*\* Execute create:page  
rake aborted!  
undefined method `top_level_tasks' for #<Rake::Application:0xb7bc7354> /var/lib/gems/1.8/gems/webby-0.7.2/lib/webby/webby_task.rb:94:in`define\_create\_tasks’  
/usr/lib/ruby/1.8/rake.rb:387:in `call' /usr/lib/ruby/1.8/rake.rb:387:in`execute’  
/usr/lib/ruby/1.8/rake.rb:387:in `each' /usr/lib/ruby/1.8/rake.rb:387:in`execute’  
/usr/lib/ruby/1.8/rake.rb:357:in `invoke' /usr/lib/ruby/1.8/rake.rb:350:in`synchronize’  
/usr/lib/ruby/1.8/rake.rb:350:in `invoke' /usr/lib/ruby/1.8/rake.rb:1924:in`run’  
/usr/lib/ruby/1.8/rake.rb:1924:in `each' /usr/lib/ruby/1.8/rake.rb:1924:in`run’  
/usr/bin/rake:4

Any help?

---

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [February 4, 2008, 11:20pm UTC](https://www.ruby-forum.com/t/webby-gems-and-paths/128089/2 "2008-02-04T23:20:47Z")

</div>

On the webby create:page problem I was having, I can get a page  
to be created if I change “top\_level\_tasks” to “collect\_tasks”:

/var/lib/gems/1.8/gems/webby-0.7.2/lib/webby/webby\_task.rb:

```
  desc "create a new #{name}"
  task name do |t|
    raise "Usage: rake #{t.name} path" unless ARGV.length == 2

    #page = t.application.top_level_tasks.pop
    page = t.application.collect_tasks.pop

    name = ::Webby::File.basename(page)
    ext = ::Webby::File.extname(page)
    dir = ::Webby::File.dirname(page)

```

That works, but I do get a (superfluous?) error from Rake:  
Don’t know how to build task ‘about’

Leslie

---

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [February 4, 2008, 11:24pm UTC](https://www.ruby-forum.com/t/webby-gems-and-paths/128089/3 "2008-02-04T23:24:53Z")

</div>

On Feb 4, 2008, at 2:43 PM, Leslie V. wrote:

> /usr/local/lib/webby (LoadError)
> 
> …so I have to cd to /var/lib/gems…etc. to run it.

What version of “gem” do you have installed?

$ gem --version

> Is there something wrong with my gems setup? Also, once I had build my  
> Webby site,  
> I had to put “require ‘rubygems’” in tasks/setup.rb before anything  
> would work.

Okay, that was my bad. It will be fixed in the next release.

> \*\* Execute create:page  
> /usr/lib/ruby/1.8/rake.rb:350:in `invoke' /usr/lib/ruby/1.8/rake.rb:1924:in`run’  
> /usr/lib/ruby/1.8/rake.rb:1924:in `each' /usr/lib/ruby/1.8/rake.rb:1924:in`run’  
> /usr/bin/rake:4

What version of rake do you have installed? You should be running the  
latest (version 0.8.1 I believe).

$ sudo gem update rake

Blessings,  
TwP

---

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [February 5, 2008, 9:48am UTC](https://www.ruby-forum.com/t/webby-gems-and-paths/128089/4 "2008-02-05T09:48:06Z")

</div>

Ok, everything seems to be working right now, although I had to  
reinstall the Webby and BlueCloth gems (local install: “gem install  
webby bluecloth”). I added the RUBYOPT environment variable and all  
seems well. Webby also looks very nice so far, although I obviously  
will need to learn Latin 😉

Thanks!

---

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [February 5, 2008, 9:30am UTC](https://www.ruby-forum.com/t/webby-gems-and-paths/128089/5 "2008-02-05T09:30:42Z")

</div>

On Feb 5, 2008 12:23 AM, Tim P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > paths:
> > 
> > /usr/local/bin/webby:4:in `require’: no such file to load –  
> > /usr/local/lib/webby (LoadError)
> > 
> > …so I have to cd to /var/lib/gems…etc. to run it.
> 
> What version of “gem” do you have installed?
> 
> $ gem --version

0.9, I have just updated to 1.01, so perhaps that will work better.

> > Is there something wrong with my gems setup? Also, once I had build my  
> > Webby site,  
> > I had to put “require ‘rubygems’” in tasks/setup.rb before anything  
> > would work.
> 
> Okay, that was my bad. It will be fixed in the next release.

Maybe not. The rubygems website says I should set my RUBYOPT  
environment variable, so that would sort this problem out.

> > undefined method `top_level_tasks' for #<Rake::Application:0xb7bc7354> /usr/lib/ruby/1.8/rake.rb:1924:in `each’  
> > /usr/lib/ruby/1.8/rake.rb:1924:in `run’  
> > /usr/bin/rake:4
> 
> What version of rake do you have installed? You should be running the  
> latest (version 0.8.1 I believe).

Ah, I have 0.7.1. Updating now…

Thanks for all your help!

Leslie
