SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WEBrick does not start

    I am doing my first little steps with RoR on Windows.
    Following the book I installed InstantRails but on my first attempt to run something I come to a screeching halt:

    C:\InstantRails\rails_apps\shovell>ruby script/server
    ./script/../config/boot.rb:29: undefined method `gem' for main:Object (NoMethodE
    rror)
    from script/server:2

    This was supposed to start WEBrick - I have no idea to look for and find what the problem might be.

    Thanks
    Gunter

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it's better to use the normal Ruby + Rails version. It's almost as easy to install and it probably works.

    Download the One Click Ruby Installer and install. Then open a terminal and type `gem install rails`.

  3. #3
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the hint - where would I find that installer?
    What I worried about is that with the different installation I will not be able to follow the tutorials in the book.
    And if the book does not help me getting up to speed - what's the point in buying the book, right?

    Cheers
    gezi

  4. #4
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nearly all things will be the same. Google knows where the installer is.

  5. #5
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [rant]

    I'm happy to know that installing all of the parts independently works well. However, it does not answer the question.

    The book suggests using the InstantRails installation and that is what we are doing. What we wish to know is why we receive the WEBrick error using that installation - not a workaround using some alternative installation method; That defeats the purpose of following the book. Personally, phrases like "almost as easy" and "probably works" don't do much to instill any confidence in the proposed solution either.

    If the community at-large does not have an answer, perhaps the author (or Mr. Hibbs himself - if he is monitoring this forum) would care to respond.

    [/rant]

    Thank-you,
    -Rod

  6. #6
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm happy to know that installing all of the parts independently works well. However, it does not answer the question.
    You didn't ask anything in the first post.

    Thanks for the hint - where would I find that installer?
    What I worried about is that with the different installation I will not be able to follow the tutorials in the book.
    And if the book does not help me getting up to speed - what's the point in buying the book, right?
    I answered these questions.

    Installing Rails using the One Click Ruby Installer and RubyGems does solve your problem.

    The book suggests using the InstantRails installation and that is what we are doing. What we wish to know is why we receive the WEBrick error using that installation - not a workaround using some alternative installation method; That defeats the purpose of following the book. Personally, phrases like "almost as easy" and "probably works" don't do much to instill any confidence in the proposed solution either.
    I added these phrases because I'm not 100% sure it works. If you prefer I can say "it works", but that isn't true. Installing Rails without using InstantRails doesn't defeat the purpose of reading the book. It think it doesn't only teach how to install?

    If you want to know why you got this error you should tell us how to reproduce the error.

    If you absolutely want to use instantrails (which is stupid) you can try starting the application this way: http://instantrails.rubyforge.org/wi...etting_Started

    It's possible that you have a new version of Rails and old RubyGems. I hope InstantRails lets you update RubyGems...

  7. #7
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You didn't ask anything in the first post.
    If you want to know why you got this error you should tell us how to reproduce the error.
    There most certainly was a question in the first post. Gunter clearly stated what command was given and what the resultant error message was. The question you should have inferred was simple: What is causing the error and what can be done to correct it?

    Installing Rails using the One Click Ruby Installer and RubyGems does solve your problem.
    I disagree. It may resolve the issue of whether or not the tools are usable going forward but it does not reolve the issue of what caused the original problem nor does it do anything to resolve the error itself.

    If you absolutely want to use instantrails (which is stupid) ...
    Casting aspersions is hardly appropriate or warranted. This is not a matter of intelligence, it is a matter of principle. That said, the book explicitly instructs the user to use a specific install. If an inexperienced user wishes to follow the examples and figures set forth in the book, then it is imperative they follow the instructions to the letter. If those instructions do not work as intended, the user has little hope of successfully following the path of instruction. While there may be viable workarounds or alternative methods that work just fine for the seasoned Ruby practitioner, the beginner will be stopped dead in their tracks wondering what to do next.

    Thank-you to those having responded so far. However, please let me be clear: The book expressly discourages the upgrading of any of the modules or using alternative software other than that prescribed within. For people just getting started with Ruby and/or Rails there is much to learn and understand. Just telling someone to run gem this or ruby that is both confusing and bewildering. No concept yet exists of what a "gem" is or what modules are even present in the system - hence, the book. Please keep this in mind when responding to questions regarding a "...beginner's guide...".

    -Rod Bollinger

  8. #8
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    UncleKyKy,

    Thank-you for your suggestion on the RubyGems update. That will indeed solve the problem with InstantRails and gets the book back on track.

    Gunter,

    On page 43, before you do the >ruby script/server call, run the following command from the console prompt:

    >gem update --system

    When this completes, go ahead and do the >ruby script/server call and launch your browser with http://localhost:3000/ as suggested - this will get you back to the output on page 44,

    Good luck,
    -Rod

  9. #9
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are a few reasons why this error could have appeared. It is possible ruby gems is not installed, though I doubt that since it most likely comes with the package (I have never used Instant Rails myself).

    Also, the old method of calling a gem was with 'require_gem' (which is now deprecated). It is possible that there are conflicting versions of software (the code can be new, and the ruby version old). Try updating ruby gems with 'gem update --system'

  10. #10
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I assumed that the goal was to get Rails running, not to get Rails running using a particular installation method.

  11. #11
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Gunter for bringing this problem to light, and thank you unclekyky and Rod for providing us with the solution. I can confirm that in my experience running 'gem --update system' solves the issue. Of course you must be online when doing this!!

    I wholeheartedly share Rod's sentiment that we do not need to be called 'stupid' for trying to follow the book's instructions to the letter, and then finding that it does not work! I have also submitted a bug report to Sitepoint, hopefully they will take action to correct the issue.

    And to Sitepoint: MANY THANKS for your excellent services, books and support. you do a lot to advance the art and science of web design and development!!!

  12. #12
    SitePoint Guru mattymcg's Avatar
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    574
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi everyone.

    It seems the most recent version of Rails (1.2.2) depends on RubyGems 0.9.0, which is something that we didn't consider when writing and editing the book. I've updated the book's errata page to reflect the fact that updating RubyGems is necessary, and will see that it is included in future versions of the book so that this hurdle is avoided.

    Tip of the hat to UncleKyKy for correctly suggesting that updating RubyGems will fix the problem.

    Quote Originally Posted by alphabyte View Post
    And to Sitepoint: MANY THANKS for your excellent services, books and support. you do a lot to advance the art and science of web design and development!!!
    Thank you alphabyte, this is much appreciated.
    I design beautiful, usable interfaces. Oh, and I wrote a kids' book.
    Follow me on Twitter.
    Read my blog.
    Buy my book, Charlie Weatherburn and the Flying Machine.

  13. #13
    SitePoint Guru mattymcg's Avatar
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    574
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fenrir2 View Post
    I assumed that the goal was to get Rails running, not to get Rails running using a particular installation method.
    Thank you also Fenrir2 for chiming in with your suggestions. Of course you are spot on with recommending that installing Ruby, Gems, Rails and SQL separately would resolve the issue. Hopefully you can empathise with those who asked the question in wanting to know why the problem was occurring in the first place.

    However I do concur that there is much to be said for installing these packages from scratch. In the book, the author and I discussed at considerable length the pros and cons of using a package like InstantRails, and in fact rewrote the installation chapter a few times because the goal posts for Rails were moving so much during the writing of the book. For complete beginners, there is no question that InstantRails has its advantages. However, as we've seen here, an "easy win" can sometimes come with unforeseen baggage. Hindsight is a wonderful thing.
    I design beautiful, usable interfaces. Oh, and I wrote a kids' book.
    Follow me on Twitter.
    Read my blog.
    Buy my book, Charlie Weatherburn and the Flying Machine.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •