How to create Rakefile manually in terminal, outside of Rails project

While I was workout on my GIT coding skills, following one of the best “learn by doing” labs ( for “git” I stuck at lab 21 .

After installed

gem install rake

Then completed installation AND

While I figured out what is a rake and how to use it I stuck! I found that the step about how to create Rakefiles without rails is not explained clearly in tutorial, even in the “ruby/rake”  documentation on github.


“Let’s add a Rakefile to our repository. The following one will do nicely.” (But it isn’t as I expect!)

I had created a file Rakefile.rake using .rake extension and failed!

Solution in my case is:

Create “Rakefile” without any extension, than insert content there:

#!/usr/bin/ruby -wKU
task :default => :run
task :run do
require './lib/hello'

SO that the next steps was working correct – (Details are here).


Task is completed in Ubuntu Linux 15.04 and at great Cloud9 IDE.


  1. Github rake; 
  2. Rake Tutorial;
  3. Intro to Rake;
  4. How to generate rake task;

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s