我正在使用带有Paperclip gem的
Ruby 1.9和Rails 2.3.4来保存附件.我通过添加适当的迁移,添加(has_attached_file:video)到模型,制作表单(multipart)并添加<%= f.file_field:video%>来跟踪教程.它…
[paperclip] Saving attachments.
但是文件并没有真正上传,而且回形针添加的额外字段都是NULL!
事实上,它没有抛出任何错误让我困惑在哪里开始寻找可能的问题.我正在使用MAC OSX Leopard,它是否可能是权限的东西?如果是这样,我怎么能给我的应用程序“sudo”权限?
任何想法是什么问题或如何显示更好的日志记录,以了解在哪里寻找问题.
谢谢,
谭
日志:
sql (0.2ms) SET NAMES 'utf8' sql (0.2ms) SET sql_AUTO_IS_NULL=0 Processing PostsController#create (for 127.0.0.1 at 2009-09-26 17:08:26) [POST] Parameters: {"authenticity_token"=>"ZhEzTVQScgZxV9KY0Eo+sG5sHwn1kHgykvy11ovvfSU=","post"=>{"title"=>"asd fasdf ","description"=>"asdf as fasd f","video"=>#<File:/var/folders/RH/RHekFGKME9uDJbX4d4DG3E+++TI/-Tmp-/RackMultipart20090926-27216-m28uwg-0>,"video_link"=>"","is_notify_when_comment"=>"0"}} I'm in load_user User Columns (3.7ms) SHOW FIELDS FROM `users` User Load (0.6ms) SELECT * FROM `users` WHERE (`users`.`id` = 3) LIMIT 1 Post Columns (3.0ms) SHOW FIELDS FROM `posts` WARNING: Can't mass-assign these protected attributes: video sql (0.2ms) BEGIN Post Create (0.4ms) INSERT INTO `posts` (`title`,`description`,`video_link`,`is_notify_when_comment`,`view_count`,`is_ours`,`votes_up_count`,`votes_down_count`,`flag_count`,`is_deleted`,`user_id`,`created_at`,`updated_at`,`video_file_name`,`video_content_type`,`video_file_size`,`video_updated_at`) VALUES('asd fasdf ','asdf as fasd f','',3,'2009-09-27 00:08:27',NULL,NULL) [paperclip] Saving attachments. sql (24.0ms) COMMIT Redirected to http://localhost:3000/posts/10 Completed in 477ms (DB: 32) | 302 Found [http://localhost/posts]