ruby - Paperclip configuration to use with openshift -
i'm trying configure paperclip use openshift can't right, suggestion?
has_attached_file :photo, :styles => { :thumb=> "100x100#", :small => "400x400>" }, :url => "/assets/users_folder/:id/:style/:id.:extension", :path => env['openshift_data_dir']+"public/assets/users_folder/:id/:style/:id.:extension"
we ended doing this:
:url => "/assets/:id.:extension",<br> :path => ":rails_root/public/assets/:id.:extension" and on deploy file of openshif ( /.openshift/action_hooks/deploy ):
stored_assets="${openshift_data_dir}/assets" live_assets="${openshift_repo_dir}/public/assets" \# ensure our stored assets directory exists if [ ! -d "${stored_assets}" ]; echo " creating permanent assets directory" mkdir "${stored_assets}" fi \# create symlink stored assets unless we're uploading our own assets if [ -d "${live_assets}" ]; echo " warning: assets included in git repository, not using stored assets" else echo " restoring stored assets" ln -sf "${stored_assets}" "${live_assets}" fi that way created link our data folder (openshift_data_dir) never removed git pushes.
Comments
Post a Comment