Code example help (B1.0)
|
|
I saw Dr. Nic’s corrections for the counting web app source code, but I’m having trouble getting it to work. I’m getting a load error at line 43 of sandbox.rb (rubygems is not found). I’ve tried requiring RubyGems earlier in the code, but I still can’t get the app to start. Any ideas? |
|
|
Just a bit of additional info: if I require rubygems at the beginning of the module, I get this error (line 47): I’m running OS X 10.5.3 if that helps. |
Rune Botten
1 post
|
Probably not related, but: I have an error at line 29: If I require ‘rbconfig’ in the start of the module, all is good. |
Brian Marick
27 posts
|
Hmm… there’s a configuration problem here. I think the sandboxing came after beta 1 of the book was cut. That means the code is out of sync with the book describing it, and the code snapshot might have come in the middle of my fiddling to get the sandboxing right. I will investigate. |
Brian Marick
27 posts
|
I should have said “there may be a configuration problem here”. |
Brian Marick
27 posts
|
Try this version I didn’t do anything specific to fix the problem, but maybe it will provide more clues. Run the test suite, please. |
|
|
i got the following error:
i think the root of the error was a self compiled ruby version on my mac. i removed all the home-brewn stuff and reinstallted ruby using finks apt-get. after updating gems everything worked as expected. |
Brian Marick
27 posts
|
Perhaps it was an older version of Ruby, one that didn’t have Rubygems included in the distribution? |
|
|
i dont think so. i tried it with selfcompiled version 1.8.6 of ruby, guided by this tutorial: |
|
|
i am still having problems with code that uses require within class-methods. in these cases i had to pull up the require statement to file-level or up to requiring class. |
Brian Marick
27 posts
|
Is the problem running code out of the code distribution? If so, what code? If not, can you send me the code that breaks when you require, plus the fixed code? I’m at marick@exampler.com |
11 posts, 4 voices
