Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow heroku-rails to be used outside of rails #4

Open
myronmarston opened this issue Dec 10, 2010 · 0 comments
Open

Allow heroku-rails to be used outside of rails #4

myronmarston opened this issue Dec 10, 2010 · 0 comments

Comments

@myronmarston
Copy link
Contributor

Your gem makes configuring and deploying apps to heroku such a pleasure that I wanted to use it outside of a rails app. I have a super-simple rack app that I needed to deploy to heroku. I got your gem to work even though my work arounds are total hacks:

Gemfile:

source :rubygems

group :development do
  gem 'heroku-rails'
  gem 'rake'
  gem 'activesupport'
end

Rakefile:

require 'bundler'
Bundler.setup(:default, :development)

# heroku-rails assumes the presence of Rails.root, so we'll define it here
Rails = Object.new
def Rails.root
  @root ||= Pathname.new(File.expand_path(File.dirname(__FILE__)))
end

begin
  require 'heroku-rails'
  require 'heroku/rails/tasks'
  require 'active_support/core_ext'
rescue LoadError
  STDERR.puts "Run `bundle install` to install heroku-rails"
end

This allows me to run rake heroku:setup to set things up based on my config/heroku.yml file, and rake all heroku:deploy to deploy (even though it fails at the db:migrate step...but that doesn't matter).

It would be nice to have an officially supported way to use this outside of rails. If I may make a suggestion, what do you think about this?

  • Release a gem that works outside of rails and provides all the non-rails functionality of this gem.
  • Have this gem depend on that gem, and simply add the Rails-specific stuff.

heroku-rails is a pretty decent name, but you could call them deploku and deploku-rails :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant