PDA

View Full Version : Installing Snaps (RoR) Gallery


i5m
October 27th, 2006, 11:06 AM
I'd usually happliy plug away trying to get things working, but I don't have a lot of a free time at the moment so I was wondering if anyone else had got snaps (http://fadingred.org/trac/snaps)up and running on their OCS account and if so could they pass on some instructions?

I think it is this bit that is screwing me:


Make sure that if the base of the rails install is not at the root of the URL, that either the webserver rewrites the base (strips whatever needs to be stripped to fool rails) or that rails is aware of this change using that funky config.


I've installed snaps at: /home/username/rails_sites/snaps

My lighttpd.conf has:


server.document-root = "/home/username/public_html/"

fastcgi.server = (
".fcgi" =>
( "localhost" =>
(
"socket" => "/home/username/lighttpd-fcgi-username.socket",
"bin-path" => "/home/username/rails_sites/snaps/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "production" ),
"min-procs" => 1,
"max-procs" => 1,
"idle-timeout" => 60,
"allow-x-send-file" => "enable"
)
),




I use lighttpd for the whole domain.

If I restart lighttpd I get the following:


/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:459:in `read': No such file or directory - /home/username/rails_sites/snaps/public/../config/../config/database.yml (Errno::ENOENT)
from /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:459:in `database_configuration'
from /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:181:in `initialize_database'
from /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:84:in `process'
from /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:42:in `run'
from /home/username/rails_sites/snaps/public/../config/environment.rb:10
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
from /home/username/rails_sites/snaps/public/dispatch.fcgi:21



From the looks of it it's a simple file path problem:


No such file or directory - /home/username/rails_sites/snaps/public/../config/../config/database.yml (Errno::ENOENT)


Cheers for any help you can provide.

rob
October 27th, 2006, 05:12 PM
Your database file, database.yml, doesn't exist. Snaps includes a default file called database.tmpl.yml that must be renamed before you can use it. They do this so you'll setup the database first.

i5m
October 31st, 2006, 07:30 AM
Rob,

ta for that. I've not got it up and running yet, but you've given me something to look at. I did wonder about the file name of that file, but thought there must be some special reason so left it as it was!

i5m
November 3rd, 2006, 10:27 PM
Well somehow I managed to get snaps up and running, using the hints provided here:

Getting multiple Rails sites going on one domain using lighttpd (http://pinkpucker.net/articles/2006/01/31/getting-multiple-rails-sites-going-on-one-domain-using-lighttpd)

However, I can't upload images. It appears to be thinking about it, but then nothing happens.

The relevant bit from the production log, the bit in bold is I guess what's going wrong.


Processing ImagesController#process_upload (for 217.155.220.190 at 2006-11-03 15:18:41) [POST]
Session ID: 36373d0d13c42e497f384894321c50c9
Parameters: {"action"=>"process_upload", "controller"=>"admin/images", "imgnum"=>"1", "image"=>#<StringIO:0xb74d7e9c>}
using an old processor for Sample thumbnail_large
using an old processor for Sample thumbnail_small
using an old processor for Sample thumbnail_medium
default thumbnail_large
deleting Sample thumbnail_large
square thumbnail_small
deleting Sample thumbnail_small
Completed in 0.07760 (12 reqs/sec) | Rendering: 0.00161 (2%) | DB: 0.01019 (13%) | 200 OK [http://www.i5m.me.uk/snaps/admin/images/process_upload]


Processing Base#index (for 217.155.220.190 at 2006-11-03 15:18:42) [GET]
Session ID: 36373d0d13c42e497f384894321c50c9
Parameters: {}


ActionController::RoutingError (Recognition failed for "/submissions/default/4_Sample_thumbnail_large.jpg"):
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:522:in `recognition_failed'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:512:in `recognize!'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process_request'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in `process!'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!'
/home/i5m/rails_sites/snaps/public/dispatch.fcgi:24



Is this anything to do with how I've had to get Snaps up and running?

rob
November 4th, 2006, 05:04 AM
This doesn't appear to be related to the configuration of the server or your Lighttpd config.

Check to make sure that the directory it uploads to has sufficient permissions to be written to. Try 777, and if that works, then set it to 775 and try again. If that works, try 755. Essentially, you want to use the highest setting possible.

However, since you're running Lighttpd, permissions shouldn't matter, but just to be sure, check this anyway. Especially if you ran it at some point in time under regular CGI or FastCGI with Apache.

i5m
January 8th, 2007, 06:45 AM
I heard back off the developer whose opinion is that the problems are with RMagick being buggy. That's also why development has pretty much stopped on it.