ssh root@YOURDOMAIN
adduser deploy
visudo # Add deploy ALL=(ALL) ALL
| #!/usr/bin/env bash | |
| apt-get -y update | |
| apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
| cd /tmp | |
| wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
| tar -xvzf ruby-1.9.3-p125.tar.gz | |
| cd ruby-1.9.3-p125/ | |
| ./configure --prefix=/usr/local | |
| make | |
| make install |
| class OauthController < ApplicationController | |
| class ApiOAuthError < StandardError | |
| attr_accessor :code, :description, :uri, :state | |
| def initialize(code, description, uri = nil, state = nil) | |
| @code = code | |
| @description = description | |
| @uri = uri |
| class Api::RegistrationsController < Api::BaseController | |
| respond_to :json | |
| def create | |
| user = User.new(params[:user]) | |
| if user.save | |
| render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
| return | |
| else |
Note that this validation runs both after the file is uploaded and after CarrierWave has processed the image. If your base uploader includes a filter to resize the image then the validation will be run against the resized image, not the original one that was uploaded. If this causes a problem for you, then you should avoid using a resizing filter on the base uploader and put any specific size requirements in a version instead.
So instead of this:
require 'carrierwave/processing/mini_magick'
With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)
Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
Processing by HomeController#index as HTML
User Load (0.2ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
Rendered layouts/_nav.html.erb (363.4ms)