Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allow apps that don't use a DB #60

Closed
wants to merge 1 commit into from

3 participants

@ahawkins

The current build pack blows up in this case. If you are running a simple rack app without a database an error is raised. The error is raised by this code:

begin
  uri = URI.parse(ENV["DATABASE_URL"])
rescue URI::InvalidURIError
  raise "Invalid DATABASE_URL"
end

This commit introduces a simple guard.

@ahawkins

@hone can you take a look at this when you get a chance?

@catsby

Hey @twinturbo, can you confirm this is still an issue? I created a Sinatra app recently with no database and no errors

@ahawkins

@ctshryock ya it's still happening. Perhaps @schneems can merge this :)

@hone
Owner

@ahawkins is this still an issue? I create simple rack apps without a db often. Can you provide a repro? I think was caused by the other issue by wrong ruby/rack/rails detection.

@ahawkins
@hone
Owner

Awesome, thanks!

@hone hone closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 13, 2013
  1. Allow apps that don't use a DB

    twinturbo authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/language_pack/ruby.rb
View
4 lib/language_pack/ruby.rb
@@ -447,8 +447,10 @@ def syck_hack
# writes ERB based database.yml for Rails. The database.yml uses the DATABASE_URL from the environment during runtime.
def create_database_yml
+ return unless ENV['DATABASE_URL']
+ return unless File.directory?("config")
+
log("create_database_yml") do
- return unless File.directory?("config")
topic("Writing config/database.yml to read from DATABASE_URL")
File.open("config/database.yml", "w") do |file|
file.puts <<-DATABASE_YML
Something went wrong with that request. Please try again.