RailsCasts Pro episodes are now free!

Learn more or hide this

jDeppen's Profile

GitHub User: jDeppen

Comments by jDeppen

Avatar

I have a similar scenario and I just create a password for every Customer

Avatar

downcase on create and when you authenticate

Avatar

What about setting a password for the user then in step 3, having the user set (change) his/her password?

Avatar

(using ubuntu 12.10)

ruby
vim ~/.bashrc # add rbenv to the top
vim: command not found

So I used

ruby
sudo apt-get install vim
Avatar

I'm able to rehash now

ruby
mv /Users/jason/.rbenv/shims/.rbenv-shim /Users/jason/.rbenv/shims/.rbenv-shim2

I'm not sure why but it started working after I ran

ruby
brakeman -o output.html
Avatar

after gem install brakeman and adding it to my gemfile, I keep getting

ruby
zsh: command not found: brakeman

and rbenv rehash gives me

ruby
rbenv: cannot rehash: /Users/jason/.rbenv/shims/.rbenv-shim exists
Avatar

Here's what I got

ruby
Restarting nginx: nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/sites-enabled/<appname>:1

So I had to keep these lines outside the server block to make it work:

ruby
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

All of my apps had:

ruby
listen 80;

except for my main app, it had:

ruby
listen 80 default deferred;

So the only difference is I don't have a default app (IP address gets 404 Not Found)

Thanks for your post, that DRYs it up a bit.

Avatar

You can't use "upstream unicorn", you have to customize for each app "upstream unicorn_app1". I got stuck there too.

Avatar

Give this a try

ruby
:primary => true
Avatar

Got it. I had to customize nginx.conf

ruby
upstream unicorn_app1 {
  server unix:/tmp/unicorn.app1.sock fail_timeout=0;
}

server {
  listen 80;
  server_name app1.com;
  root /home/deployer/apps/app1/current/public;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @unicorn;
  location @unicorn {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn_app1;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
}

I used this with my "main" app

ruby
  listen 80 default deferred;

Do you see any ways to improve this?

Avatar

How would I configure multiple websites on the same box? I know they would each be in a different directory by application name but how would I redirect using domain name. I know I would have to use apache virtual hosts but with Nginx I'm not sure.

Would it be better to have one IP address or multiple (looks like $1/IP on Linode).

Avatar

Any suggestions to avoid class="span3"? It seems like it would be a maintenance headache.

Docs:
"Use the same .span* classes from the grid system for input sizes."

Avatar

Thanks Ryan, this is perfect for me. My pages are very complex involving multiple models and they only change once per day. I only have a couple user-specific elements to load via JS. Time to get to work implementing this.

Avatar

I've wanted to implement this for some time now but had a few questions:
1) Should the URL change? i.e. /?page=2
2) What happens when you click a product then click back, are all the same products still loaded? I have seen this problem with a couple websites that use Endless Page.

Thanks

Avatar

Rather than using acts_as_list could we just give the position a default value? (i.e. 10000)

Avatar

sudo gem install aanand-deadweight
didn't work for me but this did
sudo gem install deadweight
https://github.com/aanand/deadweight/issues/8