Matthew Ruddy
Matthew Ruddy

Reputation: 925

Using Rake gem, no rakefile found

I'm trying to build a custom version of Zepto.js with the optional data module. I'm a bit new to using terminal commands, so when things don't work I'm generally unsure what to do!

I'm on a Mac and have installed Ruby 1.9.3p385. When installing the Rake gem using 'gem install rake', it seems to install fine. However, using the 'rake' command throws this error:

rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/Users/matthew_ruddy/.rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `eval'
/Users/matthew_ruddy/.rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

I'm not what to do from here. I also can't get the 'bundle' gem to work, it throws the following error:

Could not locate Gemfile

Clueless where to go from here. Here is the list of gems installed I get when I run 'gem list'.

*** LOCAL GEMS ***

bigdecimal (1.1.0)
bundle (0.0.1)
bundler (1.2.4)
io-console (0.3)
json (1.5.4)
minitest (2.5.1)
rake (10.0.3, 0.9.2.2)
rdoc (3.9.5)
rubygems-bundler (1.1.0)
rvm (1.11.3.6)

Greatly appreciate any help!

Upvotes: 0

Views: 3547

Answers (1)

dan
dan

Reputation: 106

At a guess, you're in the wrong directory.

You need to change to the right directory using the "cd" command. You can figure out what directory you're in using the "pwd" command.

Here are the steps I used to install on my computer:

  1. checkout the repository into /tmp/zepto

    dan@computer:/home$ cd /tmp
    dan@computer:/tmp$ git clone 
    dan@computer:/tmp$ git clone [email protected]:madrobby/zepto.git
    Cloning into 'zepto'...
    remote: Counting objects: 5721, done.
    remote: Compressing objects: 100% (1962/1962), done.
    remote: Total 5721 (delta 3937), reused 5333 (delta 3602)
    Receiving objects: 100% (5721/5721), 6.11 MiB | 475 KiB/s, done.
    Resolving deltas: 100% (3937/3937), done.
    
  2. change to the /tmp/zepto directory

    dan@computer:/tmp$ cd zepto/
    dan@computer:/tmp/zepto (master)$ pwd
    /tmp/zepto
    
  3. Install the gems with bundler

    dan@computer:/tmp/zepto (master)$ bundle
    Fetching gem metadata from http://rubygems.org/....
    Fetching https://github.com/lautis/uglifier
    remote: Counting objects: 750, done.
    remote: Compressing objects: 100% (386/386), done.
    remote: Total 750 (delta 381), reused 670 (delta 304)
    Receiving objects: 100% (750/750), 278.16 KiB | 283 KiB/s, done.
    Resolving deltas: 100% (381/381), done.
    Installing rake (0.9.2.2) 
    Installing multi_json (1.6.1) 
    Installing execjs (1.4.0) 
    Using uglifier (1.3.0) from https://github.com/lautis/uglifier (at master) 
    Using bundler (1.2.3) 
    Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
    
  4. Build zepto with rake

    dan@computer:/tmp/zepto (master)$ bundle exec rake
    Original version: 54.021k
    Minified: 24.897k
    Minified and gzipped: 9.258k, compression factor 5.835
    
  5. Check that the zepto.js file has been built

    dan@computer:/tmp/zepto (master)$ ls -l dist/
    total 124
    -rw-rw-r-- 1 daniel daniel 55317 Feb 23 23:32 zepto.js
    -rw-rw-r-- 1 daniel daniel 25495 Feb 23 23:32 zepto.min.js
    -rw-rw-r-- 1 daniel daniel 38097 Feb 23 23:32 zepto.min.js.map.json
    

Upvotes: 1

Related Questions