This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/aaa_load_app_config.rb | |
# | |
# Prefixed with "aaa_" so that it is loaded first and app configs can be used in later initializers | |
require 'ostruct' | |
::AppConfig = OpenStruct.new(YAML.load_file(Rails.root.join('config', 'app_config.yml')).with_indifferent_access) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :shared_files, %w(config/database.yml config/app_config.yml public/sitemap_index.xml) | |
namespace :deploy do | |
desc 'Symlink shared configs and folders on each release.' | |
task :symlink_shared do | |
global_shared_files.each do |shared_file| | |
run "ln -nfs #{shared_path}/#{shared_file} #{release_path}/#{shared_file}" | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
if ARGV.length != 2 | |
puts <<-TEXT | |
Error: wrong number of arguments. Include your app's consumer token and secret: | |
get_twitter_oauth_credentials.rb CONSUMER_TOKEN CONSUMER_SECRET | |
Get your consumer token and secret by registering your app at https://twitter.com/apps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# old | |
httpauth = Twitter::HTTPAuth.new(username, password) | |
base = Twitter::Base.new(httpauth) | |
# new | |
oauth = Twitter::OAuth.new(consumer_token, consumer_secret) | |
oauth.authorize_from_access(access_token, access_secret) | |
base = Twitter::Base.new(oauth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Encoding::CompatibilityError: incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string) | |
GEM_ROOT]/gems/activesupport-3.0.3/lib/active_support/cache/mem_cache_store.rb:161:in `gsub' | |
[GEM_ROOT]/gems/activesupport-3.0.3/lib/active_support/cache/mem_cache_store.rb:161:in `escape_key' | |
[GEM_ROOT]/gems/activesupport-3.0.3/lib/active_support/cache/mem_cache_store.rb:128:in `read_entry' | |
[GEM_ROOT]/gems/activesupport-3.0.3/lib/active_support/cache/strategy/local_cache.rb:124:in `read_entry' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in config/initializers/ | |
# prefixed with 'aaa_' so it's loaded first and app configs can be used in the following initializers | |
require 'ostruct' | |
config = File.read(Rails.root.join('config', 'app_config.yml')) | |
unless config.empty? | |
::AppConfig = OpenStruct.new(YAML.load(ERB.new(config).result).with_indifferent_access) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails_env = ENV['RAILS_ENV'] or raise "RAILS_ENV not set" | |
rails_root = ENV['RAILS_ROOT'] or raise "RAILS_ROOT not set" | |
num_workers = rails_env == 'production' ? 1 : 1 | |
num_workers.times do |num| | |
God.watch do |w| | |
w.dir = "#{rails_root}" | |
w.name = "resque-#{num}" | |
w.group = 'resque' | |
w.interval = 30.seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'amazon_product' | |
require 'csv' | |
AWSKey = '' | |
AWSSecret = '' | |
AWSAssociateTags = { | |
:de => '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> Booting WEBrick | |
=> Rails 3.0.10 application starting in development on http://0.0.0.0:3000 | |
=> Call with -d to detach | |
=> Ctrl-C to shutdown server | |
Exiting | |
/Users/me/.rvm/gems/ruby-1.9.2-p290@rails3/gems/activesupport-3.0.10/lib/active_support/whiny_nil.rb:48:in `method_missing': undefined method `failure_app=' for nil:NilClass (NoMethodError) | |
from /Users/me/.rvm/gems/ruby-1.9.2-p290@rails3/gems/devise-1.4.2/lib/devise.rb:405:in `configure_warden!' | |
from /Users/me/.rvm/gems/ruby-1.9.2-p290@rails3/gems/devise-1.4.2/lib/devise/rails/routes.rb:7:in `finalize_with_devise!' | |
from /Users/me/.rvm/gems/ruby-1.9.2-p290@rails3/gems/railties-3.0.10/lib/rails/application.rb:128:in `block in reload_routes!' | |
from /Users/me/.rvm/gems/ruby-1.9.2-p290@rails3/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2011-09-20T12:06:55+00:00 heroku[api]: Add-on remove cron:daily by [email protected] | |
2011-09-20T12:06:55+00:00 heroku[api]: Release v24 created by [email protected] | |
2011-09-20T12:06:56+00:00 heroku[web.1]: State changed from up to bouncing | |
2011-09-20T12:06:56+00:00 heroku[web.1]: State changed from bouncing to created | |
2011-09-20T12:06:56+00:00 heroku[web.1]: State changed from created to starting | |
2011-09-20T12:06:57+00:00 heroku[web.1]: Stopping process with SIGTERM | |
2011-09-20T12:06:57+00:00 app[web.1]: >> Stopping ... | |
2011-09-20T12:06:57+00:00 app[web.1]: Exiting | |
2011-09-20T12:06:57+00:00 heroku[web.1]: Process exited | |
2011-09-20T12:06:58+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 4269` |
OlderNewer