SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Rake 'require' error on VPS

  1. #1
    Community Advisor silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    1,642
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)

    Rake 'require' error on VPS

    First, I have scoured the Internet for days and this problem is plaguing me. I need help from someone with Ruby on Rails experience on a VPS.

    I have always developed rails apps on shared hosting. For the first time I have a "hands on" (physical) internal server I need to use for deploying a proprietary RoR app.

    After installing Ruby, installing rails, installing MySQL, setting up Apache2 I have proven my Ubuntu Server is working as expected.
    The command 'rails <appname>' worked perfectly.

    Next I tried running rake.
    I got this error:
    Code:
    /usr/bin/rake:27 'require' : no such file to load -- (LoadError) rake
    Hopefully, you can guide me on how to overcome this stumbling block. It is the last thing that stands in my way to success on this project (which, of course, has a tight deadline).
    {btw: the rake file is only 28 lines long. It simply calls this include then calls Rake.application.run }

    Reading on the Internet, I see a change in Ruby 1.8.6 and Ruby 1.9 with respect to how gems are handled.
    I was unsuccessful as installing Ruby 1.9 on this box. But I really don't believe that is the fix for my problem.

    Thanks in advance.
    Last edited by ParkinT; Oct 29, 2008 at 10:52.

  2. #2
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All I can think of is maybe your unsuccessful attempt screwed up the environment variables. It sounds like it's looking for something in the wrong place.

  3. #3
    Community Advisor silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    1,642
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    I had (have) Ruby 1.8.6 installed and working (irb VERSION verifes that).
    My attempt to install 1.9 was an effort to fix this rake issue.
    I agree that it appears to be a pathing issue. It was my hope that someone who has stumbled across this before has the magic answer.

    Thanks for reading the post.

  4. #4
    Community Advisor silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    1,642
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    I am happy to report that I solved my problem.
    It appears the solution was thus (although I have been doing many things. But even after a reboot it continues to work):
    run the command (as root) $ usr/ruby/env to display the ruby environment vars
    Look at the GEM_HOME value
    Performed an 'export' of that to GEM_PATH
    I then reinstalled rake with 'gem install rake'
    After that it worked as expected.

  5. #5
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great! I was about to suggest you look at GEM_OPT, glad you found it before I sent you down the wrong rabbit-hole.

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
  •