ActionView::Template::Error (logo.png isn't precompiled):
我用rails g mongoid:config
生成的config/mongoid.yml
没有默认的生产环境配置。
/opt/nginx/logs/error.log*
2013/03/14 22:38:51 [error] 17086#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 115.195.168.193, server: darkedog.com, request: "GET / HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "darkedog.com"
[ pid=17099 thr=69414950 file=utils.rb:176 time=2013-03-14 22:38:51.309 ]: *** Exception Mongoid::Errors::NoSessionsConfig in application (
Problem:
No sessions configuration provided.
Summary:
Mongoid's configuration requires that you provide details about each session that can be connected to, and requires in the sessions config at least 1 default session to exist.
Resolution:
Double check your mongoid.yml to make sure that you have a top-level sessions key with at least 1 default session configuration for it. You can regenerate a new mongoid.yml for assistance via `rails g mongoid:config`.
Example:
development:
sessions:
default:
database: mongoid_dev
hosts:
- localhost:27017
) (process 17099, thread #<Thread:0x846604c>):
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid/sessions/factory.rb:61:in `create_session'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid/sessions/factory.rb:43:in `default'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid/sessions.rb:109:in `default'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid.rb:129:in `default_session'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid/railtie.rb:149:in `block (3 levels) in <class:Railtie>'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/public_api.rb:40:in `call'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/public_api.rb:40:in `block in call_event'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/public_api.rb:39:in `each'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/public_api.rb:39:in `call_event'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb:399:in `before_handling_requests'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb:470:in `safe_fork'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:180:in `start'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
from <internal:prelude>:10:in `synchronize'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server:99:in `<main>'
/home/yuwen/darkedog/log/production.log
Started GET "/" for 115.195.168.193 at 2013-03-14 22:35:32 -0400
Processing by WelcomeController#index as HTML
Rendered welcome/index.html.slim within layouts/application (0.7ms)
Completed 500 Internal Server Error in 1ms
ActionView::Template::Error (logo.png isn't precompiled):
1: = image_tag("logo.png", :class => "logo")
2: h1.hero =("2013移动互联网")
app/views/welcome/index.html.slim:1:in `_app_views_welcome_index_html_slim__867937906_86812840'
Started GET "/" for 115.195.168.193 at 2013-03-14 22:35:32 -0400
Processing by WelcomeController#index as HTML
Rendered welcome/index.html.slim within layouts/application (0.7ms)
Completed 500 Internal Server Error in 1ms
ActionView::Template::Error (logo.png isn't precompiled):
1: = image_tag("logo.png", :class => "logo")
2: h1.hero =("2013移动互联网")
app/views/welcome/index.html.slim:1:in `_app_views_welcome_index_html_slim__867937906_86812840'
Started GET "/" for 115.195.168.193 at 2013-03-14 22:36:05 -0400
Processing by WelcomeController#index as HTML
Rendered welcome/index.html.slim within layouts/application (48.4ms)
Completed 500 Internal Server Error in 89ms
ActionView::Template::Error (logo.png isn't precompiled):
1: = image_tag("logo.png", :class => "logo")
2: h1.hero =("2013移动互联网.")
app/views/welcome/index.html.slim:1:in `_app_views_welcome_index_html_slim___380704576_79359030'
@caoxg 能否抄一部分你们的招聘内容?我会尽量借鉴的抄。
#3 楼 @happypeter #4 楼 @zz 看来还是继续买 VPS 了,我之前买了一个月的 linode。
前几天我也在西安遛了一下,感觉不错,现在在敦煌,过几天可能还回去西安待两天,玩!
#5 楼 @wujinlong 那我不知道了,我 google 翻了底朝天了就找到那两个方法。
只有 python 写的那个可以下载,但是 pull 都是 512x512 的图片,需要自己拼接。有时间,我可以把我自己的一些大图上传分享。
#3 楼 @wujinlong 非常费劲,下载的原始图片都是经过 google 加密过被裁剪成 512 像素乘以 512 像素的小图片了,所以即使可以把所有的碎片都 pull 下来,但是还得花费相当大的功夫,用软件去拼接起来。
但是在 wiki 上有一部分比较高清的图片 (看你能否找到自己喜欢的了): https://commons.wikimedia.org/wiki/Category:Google_Art_Project
收藏了,谢谢!
收藏了 谢谢!
太酷了!
这么多种方式?
谢谢 哈哈!节日快乐!
我在 console 里面看到:
[#<Photo id: 48, work_id: 0, created_at: "2012-09-27 11:34:28", updated_at: "2012-09-27 11:34:28", image: "brainhub.png">]
是没有关联上去。
works
和photos
的 controller 基本是一样的,
`
def create
@work = Work.new(params[:work])
if @work.save
redirect_to admin_category_path(@work.category), notice: "Successfully created."
else
render "new"
end
end
但是不知道为什么创建 works 的时候,正常。创建 photos 的时候就出错。
#1 楼 @chucai 我就是觉得那个 id 都多余, 想要这样的效果: http://huacnlee.com/blog/rails-app-image-store-with-carrierwave-upyun/
我感觉每次打开 railscasts 都特别慢,特别慢