How does WEBrick load Gems requested at runtime?


#1

I am trying to use a Gem in my application.

I have verified that I am “requiring” it correctly in my controller.

When I go to access a name in the Gem, I get an “uninitialized constant”
error.

However, if I wait a few minutes, it seems like the symbol then becomes
available.

Is there some kind of polling going on here in WEBrick where it’s
attempting to discover Gems?

Here are a couple of scenarios:

  1. I’m not changing any code and restarting my WEBrick server and I
    can’t see the symbol anymore.

So, basically, can anyone elucidate the relationship between WEBrick and
Gems?

Do I need to use the --rubygems option when I do

“ruby script/server”

Thanks,
Wes