could not get environment of heroku app, though changed ways to check the current environment
This commit is contained in:
committed by
Thomas Buchöster
parent
2f8e936372
commit
195fbc7554
@@ -7,7 +7,7 @@ require 'rake'
|
|||||||
|
|
||||||
module ::Nineminutes
|
module ::Nineminutes
|
||||||
class Application
|
class Application
|
||||||
include Rake::DSL
|
include Rake::DSL if Rails.env.development? or Rails.env.test?
|
||||||
# Jammit.package!
|
# Jammit.package!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
if Rails.env !=~ /production/
|
if Rails.env.development? || Rails.env.test?
|
||||||
APP_CONFIG = HashWithIndifferentAccess.new(YAML.load(File.open(File.join(Rails.root, 'config', 'config.yml'))))
|
APP_CONFIG = HashWithIndifferentAccess.new(YAML.load(File.open(File.join(Rails.root, 'config', 'config.yml'))))
|
||||||
APP_CONFIG.each do |key, value|
|
APP_CONFIG.each do |key, value|
|
||||||
if value.is_a?(Hash)
|
if value.is_a?(Hash)
|
||||||
|
|||||||
@@ -183,12 +183,12 @@ Devise.setup do |config|
|
|||||||
# up on your models and hooks.
|
# up on your models and hooks.
|
||||||
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
||||||
|
|
||||||
|
if Rails.env.development? or Rails.env.test?
|
||||||
|
config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET']
|
||||||
|
else
|
||||||
# Facebook-Setting for Heroku
|
# Facebook-Setting for Heroku
|
||||||
if Rails.env =~ /production/
|
|
||||||
config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET']
|
config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET']
|
||||||
{:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}
|
{:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}
|
||||||
else
|
|
||||||
config.omniauth :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_SECRET']
|
|
||||||
end
|
end
|
||||||
|
|
||||||
config.omniauth :open_id, OpenID::Store::Filesystem.new('/tmp')
|
config.omniauth :open_id, OpenID::Store::Filesystem.new('/tmp')
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ begin
|
|||||||
$redis.ping
|
$redis.ping
|
||||||
puts "=> Established connection to redis server on '#{uri.host}' (port #{uri.port})!"
|
puts "=> Established connection to redis server on '#{uri.host}' (port #{uri.port})!"
|
||||||
rescue
|
rescue
|
||||||
puts "=> CAUTION: cound not establish connection to redis server on '#{uri.host}' (port #{uri.port})! Check settings in initializer!"
|
puts "=> CAUTION: could not establish connection to redis server on '#{uri.host}' (port #{uri.port})! Check settings in initializer!"
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user