Skip to content
RakeUp provides a set of turn-key Rake tasks for running a local Rack based server application
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib Change default port to localhost instead of `nil`
.gitignore Initial commit
.ruby-version Add .ruby-version
Gemfile Bump basic dependencies
Gemfile.lock Bump basic dependencies
LICENSE Fix typo in command in README (`rakeup` instead of `rackup`)
Rakefile Checking in RakeUp 1.0.0
VERSION Bump version to 1.2.0
rakeup.gemspec Bump version to 1.2.0


RakeUp provides a set of turn-key Rake tasks for running a local Rack based server application. By configuring a single block in your Rakefile, you will have access to a rich set of tasks for start, stopping, and monitoring your server. These tasks are essentially thin wrappers around the rackup command and are useful for running lightweight applications that are used for local development and testing.

This project was developed for use with the test server of the RestKit project on iOS. RestKit runs numerous tests over HTTP against a local server and RakeUp provides the management of that server instance.

Example Rakefile

require 'rubygems'
require 'bundler/setup'
require 'rakeup' do |t|
  t.port = 8558
  t.pid_file = 'tmp/'
  t.rackup_file = ''
  t.server = :thin

After configuring the task, you can run rake -T server to see your new server management tasks:

rake server                       # Run the server in the foreground
rake server:abort_unless_running  # Abort the task chain unless the server is running
rake server:autostart             # Starts the server if there is not already an instance running
rake server:autostop              # Stops the server if executed via autostart
rake server:restart               # Restart the server daemon
rake server:start                 # Start the server daemon
rake server:status                # Check the status of the server daemon
rake server:stop                  # Stop the server daemon

If you wish to synthesize your tasks under a name other than 'server' you can provide a string when initializing the server task:"other_name").


To add RakeUp to your application, edit your Gemfile to import the RakeUp gem:

gem 'rakeup', '~> 1.0'

And then edit your Rakefile to import the RakeUp library and configure your server tasks:

require 'rubygems'
require 'bundler/setup'
require 'rakeup' do |t|
  t.port = 8558
  t.pid_file = 'Tests/Server/'
  t.rackup_file = 'Tests/Server/'
  t.server = :thin # Or puma, mongrel, etc.

Supported Web Servers

Any web server that is imported by your Gemfile and has a Rack handler available is available for execute. Commonly used servers are thin, mongrel, webrick, and puma. See rackup --help for more examples.

Customizing the Tasks

At its core, RakeUp is simply a convenience wrapper around rackup commandline invocations. You can customize the rake tasks by overriding the run, start, stop, and restart commands when configuring the server: do |t|
  t.port = 8558
  t.pid_file = 'Tests/Server/'
  t.rackup_file = 'Tests/Server/'
  t.log_file = 'Tests/Server/server.log'

  # Run Thin directly
  t.run_command = "thin -r #{t.rackup_file} -P #{t.pid_file} -p #{t.port} start"
  t.start_command = "thin -r #{t.rackup_file} -P #{t.pid_file} -p #{t.port} start -D"
  t.stop_command = "thin -r #{t.rackup_file} -P #{t.pid_file} -p #{t.port} stop"
  t.restart_command = "thin -r #{t.rackup_file} -P #{t.pid_file} -p #{t.port} restart"


Blake Watters


RakeUp is available under the Apache 2 License. See the LICENSE file for more info.

Something went wrong with that request. Please try again.