我正在尝试在Ubuntu 9.10上安装rails.
gem list --local
*** LOCAL GEMS ***
actionmailer (2.3.4, 2.3.2)
actionpack (2.3.4, 2.3.2)
activerecord (2.3.4, 2.3.2)
activeresource (2.3.4, 2.3.2)
activesupport (2.3.4, 2.3.2)
rack (1.0.1)
rails (2.3.4, 2.3.2)
rake (0.8.7)
sqlite3-ruby (1.2.5)
rake
The program 'rake' is currently not installed. You can install it by typing:
sudo apt-get install rake
rake: command not found
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
README没有显示如何处理控制器和查看设置此插件的方面.我一直在搜索几个小时,但找不到任何显示如何使用此插件的内容.
在我的linux开发环境中使用S3设置回形针非常容易 - 一切都是开箱即用的.但是,我无法让它在Heroku上工作.
当我尝试上传时,日志显示:
Processing ItemsController#create (for 72.177.97.9 at 2010-08-26 16:35:14) [POST]
Parameters: {"commit"=>"Create", "authenticity_token"=>"0Hy3qvQBHE1gvFVaq32HMy2ZIopelV0BHbrSeHkO1Qw=", "item"=>{"photo"=>#<File:/home/slugs/270862_4aa601b_4b6f/mnt/tmp/RackMultipart20100826-6286-1256pvc-0>, "price"=>"342", "name"=>"a new item", "description"=>"a new item", "sold"=>"0"}}
Paperclip::PaperclipError (Item model missing required attr_accessor for 'photo_file_name'):
Run Code Online (Sandbox Code Playgroud)
我找到了一篇引用此错误的博文,并说它将此添加到我的模型中:
attr_accessor :photo_file_name
attr_accessor :photo_content_type
attr_accessor :photo_file_size
attr_accessor :photo_updated_at
Run Code Online (Sandbox Code Playgroud)
这确实使得缺少attr_accessor所需的模型'photo_file_name'错误消失了,但它仍然不起作用.请参阅我的其他问题了解详情.正如我已经发现,随着attr_accessor行添加到我的模型中,即使在我的开发系统上,上传也会失败,我怀疑这不是正确的答案.