https://github.com/intridea/omniauth.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
Run Code Online (Sandbox Code Playgroud)
那我该怎么办?bundle install适用于开发,但是当我推送并部署到我的生产服务器时.即使在我的生产服务器上运行bundle install之后,我也会收到此错误.
我无法使send_file(Model.attachment.path)工作.它不会失败,相反,它会向客户端发送一个0字节大小的文件,但文件名是正确的.
在我从Rails 2.3.8迁移到3之后,这个问题开始发生了.
此次迁移中还发生了很多其他事情,我会尽力详细说明所有这些事情.
我通过ftp移动附件,因为它们不是我的git存储库的一部分,因此它们通过cap deploy发布,而不是手动ftp远程(RHEL5)到本地(Win7)然后本地(Win7)到远程(Ubuntu10).
我知道FTPing不会通过传输保留文件权限,所以我所做的就是模仿我之前服务器上看到的chmod,因此它们几乎相同.(用户/组不同,设置为root:root而不是olduser:olduser).
从生产日志下载附件的请求的片段.
Started GET "/attachments/replies/1410?1277105698" for 218.102.140.205 at 2010-09-16 09:44:31 +0000
Processing by AttachmentsController#replies as HTML
Parameters: {"1277105698"=>nil, "id"=>"1410"}
Sent file /srv/app/releases/20100916094249/attachments/replies/UE0003-Requisition_For_Compensation_Leave.doc (0.2ms)
Completed 200 OK in 78ms
Run Code Online (Sandbox Code Playgroud)
一切都还好.我还要排除本地问题,我尝试在Win7和Ubuntu(在Vbox上)通过Chrome下载.
我还要向你保证,这条道路确实是正确的.
root@li162-41:/srv/app/current# tail /srv/app/releases/20100916094249/attachments/replies/UE0003-Requisition_For_Compensation_Leave.doc
#
#
%17nw
HQ??+1ae????
%33333333333(??QR???HX?"%%??@9
??@?p4??#P@??Unknown????????????G??z ?Times New Roman5??Symbol3&?
?z ?Arial5&?
Run Code Online (Sandbox Code Playgroud)
总结一下这个问题,如何让send_file实际发送文件而不是假的0字节垃圾.
我很懒,因为我的生产数据库有我可用于测试的数据,我想知道是否有任何简单的方法来生成灯具.
在1.8.7上使用Rails 3
如何在上传和保存文件后重命名文件?我的问题是我需要自动解析有关文件的信息,以便提出文件应该像我的应用程序一样保存文件名,但我无法访问生成文件名所需的信息,直到记录为止.模型已保存.
所以我已经在这个网络应用程序上工作了一年,我想编译成一个移植模式,这样我的文本编辑器加载速度更快,git工作目录不是那么混乱.
搜索查找会更快.
任何我的配置/数据库都不会长4000px.
activerecord ruby-on-rails rails-migrations rails-activerecord
我想做的事:
在model.rb中,在after_commit中,我想运行rake task ts:reindex
ts:reindex通常使用rake ts:index运行
brew安装postgresql
初始化...
[~] initdb
The files belonging to this database system will be owned by user "pma".
This user must also own the server process.
The database cluster will be initialized with locales
COLLATE: C
CTYPE: UTF-8
MESSAGES: C
MONETARY: C
NUMERIC: C
TIME: C
The default database encoding has accordingly been set to UTF8.
initdb: could not find suitable text search configuration for locale UTF-8
The default text search configuration will be set to "simple".
creating directory /Users/pma/.pgdata ... …Run Code Online (Sandbox Code Playgroud) 我一直在使用Safari作为我的开发浏览器,我发现在繁重的javascript环境中预览CSS更改非常困难.
我的Web应用程序和开发环境如下: