Skip to content

Instantly share code, notes, and snippets.

View joelklabo's full-sized avatar
Zapping

klabo joelklabo

Zapping
View GitHub Profile
<VirtualHost brooski.net:80>
ServerAdmin root@brooski.net
ServerName brooski.net
ServerAlias www.brooski.net
DocumentRoot /srv/www/brooski.net/public_html
WSGIScriptAlias / /srv/www/brooski.net/brooski/django.wsgi
<Directory /srv/www/brooski.net/brooski>
Order allow,deny
# this is my view, POST sends the brew_id, and the username in hidden form fields
def add_image(request, brew_id):
if request.method == 'POST':
brew = Brew.objects.get(pk=brew_id)
user = User.objects.get(username__exact=request.POST['user'])
form = BrewImageForm(request.POST, request.FILES)
form.save()
return HttpResponseRedirect('/brew/' + brew_id)
else:
form = BrewImageForm()
#This is the function where the error is occurring:
# Doesn't need csrf_protect since no-one can guess the URL
def password_reset_confirm(request, uidb36=None, token=None, template_name='registration/password_reset_confirm.html',
token_generator=default_token_generator, set_password_form=SetPasswordForm,
post_reset_redirect=None):
"""
View that checks the hash in a password reset link and presents a
form for entering a new password.
"""
sh-3.2# rake gems:install --trace
(in /Users/joelklabo/development/pinchd/gotribal)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `[]' for nil:NilClass
/Users/joelklabo/development/pinchd/gotribal/config/environments/development.rb:36:in `load_environment'
sh-3.2# rake gems:install --trace
(in /Users/joelklabo/development/pinchd/gotribal)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `[]' for nil:NilClass
/Users/joelklabo/development/pinchd/gotribal/config/environments/development.rb:36:in `load_environment'
@joelklabo
joelklabo / Gem install error
Created October 20, 2010 17:11
rake gems:install error
#This is what is around line 36 in development.rb which is apparently causing the error
# Loading constants from /config/local.yml (LOCAL_CONFIG const)
DEV_CONFIG = LOCAL_CONFIG[RAILS_ENV]
DEV_EMAIL = DEV_CONFIG['email']
#This is the error
sh-3.2# rake gems:install --trace
(in /Users/joelklabo/development/pinchd/gotribal)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
# this is my local.rb file:
p LOCAL_CONFIG
LOCAL_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/local.yml")
sh-3.2# rake gems:install --trace
(in /Users/joelklabo/development/pinchd/gotribal)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
#local.rb
p YAML.load_file("#{RAILS_ROOT}/config/local.yml")
#trace
sh-3.2# rake gems:install --trace
(in /Users/joelklabo/development/pinchd/gotribal)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
production:
email: 'joelklabo@gmail.com'
mysql_password: ''
postgres_password: 'joelbenjaminklabo'
development: ''
email: 'joelklabo@gmail.com'
mysql_password: ''
postgres_password: 'joelbenjaminklabo'
test: ''
email: 'joelklabo@gmail.com'
sh-3.2# rake gems:install --trace
(in /Users/joelklabo/development/pinchd/gotribal)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
rake aborted!
syntax error on line 5, col 1: ` email: 'joelklabo@gmail.com''
/opt/local/lib/ruby/1.8/yaml.rb:133:in `load'