Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

rake init fails

#1

So I grabbed the source (both from the tarball and git) and got all the deps installed according to the README, but when I try and fire things up, I get an error:

mike@mike-linux:~/Downloads/flint-git/flint$ rake init --trace

(in /home/mike/Downloads/flint-git/flint)

rake aborted!

no such file to load -- ralex/ralextask.rb

/home/mike/Downloads/flint-git/flint/rakefile.rb:1:in require'

/home/mike/Downloads/flint-git/flint/rakefile.rb:1

/usr/lib/ruby/1.8/rake.rb:2359:in load'

/usr/lib/ruby/1.8/rake.rb:2359:in raw_load_rakefile'

/usr/lib/ruby/1.8/rake.rb:1993:in load_rakefile'

/usr/lib/ruby/1.8/rake.rb:2044:in standard_exception_handling'

/usr/lib/ruby/1.8/rake.rb:1992:in load_rakefile'

/usr/lib/ruby/1.8/rake.rb:1976:in run'

/usr/lib/ruby/1.8/rake.rb:2044:in standard_exception_handling'

/usr/lib/ruby/1.8/rake.rb:1974:in run'

/usr/bin/rake:28

mike@mike-linux:~/Downloads/flint-git/flint$ head /home/mike/Downloads/flint-git/flint/rakefile.rb
require 'ralex/ralextask.rb'

I have no 'ralex' directory and I have no 'ralextask.rb' file in the tree.

Reported by Mike Johnson · March 4th, 2010 @ 06:00 PM

State: resolved
Milestone: none
Assigned to: Craig Bugzefsky Craig Bugzefsky

Activity

  1. Jonas
    Jonas

    Same issue here. Rake fails and sinatra server never starts.

    March 4th, 2010 @ 07:42 PM

  2. Craig Bugzefsky
    Craig Bugzefsky

    See above my reply to original reporter.

    I suspect the "rake" command does not match the "gem" command you uses to install the gems. That error is literally rake not finding the Ralex gem.

    March 4th, 2010 @ 07:50 PM

  3. Craig Bugzefsky
    Craig Bugzefsky
    • State changed from new to open

    Oh, and be sure that you installed the Ralex-0.1.gem and matano_utils.gem that are in the root directory of the flint project. I had assumed you did this when I replied above.

    To do so, while in flint root dir:

    gem install ./Ralex-0.1.gem
    gem install ./matasano_utils-0.1.gem
    

    March 4th, 2010 @ 08:02 PM

  4. Mike Johnson
    Mike Johnson

    Yup, that was what I did. But just to be sure, I blew away the root dir and tried again (and I tried again after fixing the PATH issue, no difference):

    mike@mike-linux:~/Downloads/flint-1.0$ pwd
    /home/mike/Downloads/flint-1.0
    mike@mike-linux:~/Downloads/flint-1.0$ gem install ./matasano_utils-0.1.gem
    WARNING:  Installing to ~/.gem since /var/lib/gems/1.9.1 and
              /var/lib/gems/1.9.1/bin aren't both writable.
    WARNING:  You don't have /home/mike/.gem/ruby/1.9.1/bin in your PATH,
              gem executables will not run.
    Successfully installed matasano_utils-0.1
    1 gem installed
    Installing ri documentation for matasano_utils-0.1...
    Updating class cache with 333 classes...
    Installing RDoc documentation for matasano_utils-0.1...
    mike@mike-linux:~/Downloads/flint-1.0$ gem install ./matasano_utils-0.1.gem
    WARNING:  Installing to ~/.gem since /var/lib/gems/1.9.1 and
              /var/lib/gems/1.9.1/bin aren't both writable.
    WARNING:  You don't have /home/mike/.gem/ruby/1.9.1/bin in your PATH,
              gem executables will not run.
    Successfully installed matasano_utils-0.1
    1 gem installed
    Installing ri documentation for matasano_utils-0.1...
    Updating class cache with 333 classes...
    Installing RDoc documentation for matasano_utils-0.1...
    mike@mike-linux:~/Downloads/flint-1.0$ rake init --trace
    (in /home/mike/Downloads/flint-1.0)
    rake aborted!
    no such file to load -- ralex/ralextask.rb
    /home/mike/Downloads/flint-1.0/rakefile.rb:1:in `require'
    /home/mike/Downloads/flint-1.0/rakefile.rb:1
    /usr/lib/ruby/1.8/rake.rb:2359:in `load'
    /usr/lib/ruby/1.8/rake.rb:2359:in `raw_load_rakefile'
    /usr/lib/ruby/1.8/rake.rb:1993:in `load_rakefile'
    /usr/lib/ruby/1.8/rake.rb:2044:in `standard_exception_handling'
    /usr/lib/ruby/1.8/rake.rb:1992:in `load_rakefile'
    /usr/lib/ruby/1.8/rake.rb:1976:in `run'
    /usr/lib/ruby/1.8/rake.rb:2044:in `standard_exception_handling'
    /usr/lib/ruby/1.8/rake.rb:1974:in `run'
    /usr/bin/rake:28
    mike@mike-linux:~/Downloads/flint-1.0$ ls
    app  checks  COPYING  doc  lib  matasano_utils-0.1.gem  rakefile.rb  Ralex-0.1.gem  README  script  spec
    

    March 4th, 2010 @ 09:12 PM

  5. Craig Bugzefsky
    Craig Bugzefsky

    Please note:

    From your gem install
    > WARNING: Installing to ~/.gem since /var/lib/gems/1.9.1 and > /var/lib/gems/1.9.1/bin aren't both writable. > WARNING: You don't have /home/mike/.gem/ruby/1.9.1/bin in your PATH,

    That indicated your "gem" program is from your 1.9 ruby

    From your "rake" run:
    > /home/mike/Downloads/flint-1.0/rakefile.rb:1:in require' > /home/mike/Downloads/flint-1.0/rakefile.rb:1 > /usr/lib/ruby/1.8/rake.rb:2359:inload'

    Rake is running your 1.8 ruby install.

    That is evidence that your gem is from 1.9 and your ruby is 1.8

    March 4th, 2010 @ 09:19 PM

  6. Mike Johnson
    Mike Johnson

    Please bare with me, I'm not a ruby guy. I fixed the symlink that was calling ruby 1.8 and told it to call 1.9:

    mike@mike-linux:~/Downloads/flint-1.0$ rake init --trace
    (in /home/mike/Downloads/flint-1.0)
    rake aborted!
    no such file to load -- ralex/ralextask.rb
    /home/mike/Downloads/flint-1.0/rakefile.rb:1:in `require'
    /home/mike/Downloads/flint-1.0/rakefile.rb:1:in `<top (required)>'
    /usr/lib/ruby/1.9.1/rake.rb:2341:in `load'
    /usr/lib/ruby/1.9.1/rake.rb:2341:in `raw_load_rakefile'
    /usr/lib/ruby/1.9.1/rake.rb:1977:in `block in load_rakefile'
    /usr/lib/ruby/1.9.1/rake.rb:2028:in `standard_exception_handling'
    /usr/lib/ruby/1.9.1/rake.rb:1976:in `load_rakefile'
    /usr/lib/ruby/1.9.1/rake.rb:1961:in `block in run'
    /usr/lib/ruby/1.9.1/rake.rb:2028:in `standard_exception_handling'
    /usr/lib/ruby/1.9.1/rake.rb:1959:in `run'
    /usr/bin/rake:28:in `<main>'
    

    March 4th, 2010 @ 09:35 PM

  7. Craig Bugzefsky
    Craig Bugzefsky

    Is this ubuntu?

    It could be that your ruby does not put your gem directories in it's ruby library path. try putting:

    require 'rubygems'

    at the top of rakefile.rb.

    If that works, then we'll need to add that to app/app.rb and script/init.rb and a bunch of other places as well.

    March 4th, 2010 @ 10:08 PM

  8. Mike Johnson
    Mike Johnson

    Yup, it's ubuntu. That didn't seem to help:

    mike@mike-linux:~/Downloads/flint-1.0$ head rakefile.rb
    require 'ralex/ralextask.rb'
    require 'rubygems'


    mike@mike-linux:~/Downloads/flint-1.0$ rake init --trace (in /home/mike/Downloads/flint-1.0) rake aborted! no such file to load -- ralex/ralextask.rb /home/mike/Downloads/flint-1.0/rakefile.rb:1:in
    require' /home/mike/Downloads/flint-1.0/rakefile.rb:1:in<top (required)>' /usr/lib/ruby/1.9.1/rake.rb:2341:in load' /usr/lib/ruby/1.9.1/rake.rb:2341:inraw_load_rakefile' /usr/lib/ruby/1.9.1/rake.rb:1977:in block in load_rakefile' /usr/lib/ruby/1.9.1/rake.rb:2028:instandard_exception_handling' /usr/lib/ruby/1.9.1/rake.rb:1976:in load_rakefile' /usr/lib/ruby/1.9.1/rake.rb:1961:inblock in run' /usr/lib/ruby/1.9.1/rake.rb:2028:in standard_exception_handling' /usr/lib/ruby/1.9.1/rake.rb:1959:inrun' /usr/bin/rake:28:in &lt;main&gt;'</code> </pre>

    March 4th, 2010 @ 11:44 PM

  9. Craig Bugzefsky
    Craig Bugzefsky

    Yah gotta make it the first line.

    That loads up the rubygems lib, and that should add your personal .gems subdirs to the path.

    I bet that is it BTW. Apparently the OSX ruby puts them in the path by default, which is why I didn't catch this earlier. I've fixed this in the git repo already.

    March 5th, 2010 @ 02:06 AM

  10. jth
    jth

    I had a different source to the same error (rake init failed). Turns out I had multiple copies of ruby. Running "which ruby" and "which gem" to make sure both looked sane (and some additional use of 'locate' to verify), I re-did the setup from the start. The only change I had to make was to also run 'gem install ruby-debug' for it all to work.

    So in total, I did the following, which worked out once I realized my path was ordered to grab the macports-installed ruby over the system's ruby, which I fixed:

    git clone http://runplaybook.com/git/flint.git

    cd flint/

    gem install sinatra haml ohm rdiscount compass bcrypt-ruby ruby-debug ./*.gem

    (install redis - on my mac with macports already present, # port selfupdate && port install redis)

    redis-server & rake init & rake app

    March 5th, 2010 @ 12:41 PM

  11. jth
    jth

    ack! hash doesn't show up correctly. Sorry for all the headings there...

    March 5th, 2010 @ 12:41 PM

  12. Mike Johnson
    Mike Johnson

    Oooookay, got it to start.

    I removed the ruby1.9.1 packages (including 1.9.1 gem) and made sure to have all the ruby1.8 (turns out on ubuntu you need the right ruby-dev package too, to install gem modules).

    I did a fresh clone from git (which has the new require statements).

    I made sure my path was right.

    I wiped my old $HOME/.gem

    And rake --init works now. For grins, I removed the "require 'rubygems'" from rakefile.rb just to make sure that was the problem, and sure enough, rake won't start without that line.

    Thanks for the help!

    March 5th, 2010 @ 06:35 PM

  13. Craig Bugzefsky
    Craig Bugzefsky
    • State changed from open to resolved

    I've fixed this on HEAD. Closing bug.

    March 5th, 2010 @ 09:40 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.