参考文章 http://guides.rubyonrails.org/asset_pipeline.html
今天将一个新的项目部署到了 生产环境的服务器上,结果fckeditor不能用了 究其原因是 rails 3.1的新特性asset_pipeline,仔细看了下,问题解决。
参考文章 http://guides.rubyonrails.org/asset_pipeline.html
今天将一个新的项目部署到了 生产环境的服务器上,结果fckeditor不能用了 究其原因是 rails 3.1的新特性asset_pipeline,仔细看了下,问题解决。
安装完毕linux后 无法启动,原因是服务器上装了一块 Raid卡 LSI卡 所以要再Ubuntu的
/etc/defalt/grub
中修改以下下参数。
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=”quiet rootdelay=60″
原文参照
https://gist.github.com/1216602
——————————————————
# 在本地服务器建立 rubygems.org 的镜像缓存,以提高 gem 的安装速度# 此配置设置缓存过期为1天,也就是说,新上的 gem 无法马上安装# 做这个起什么作用?# rubygems 的很多资源文件是存放到 Amazon S3 上面的,由于 GFW 对某些 S3 服务器又连接重置或丢包,导致 gem 安装异常缓慢或有时候根本无法连接安装。# 而通过这种跳板的方式可以很好的解决这个问题,当然前提是 Nginx反向代理 服务器需要在国外proxy_cache_path /var/cache/rubygems levels=1:2 keys_zone=RUBYGEMS:10minactive=24h max_size=1g;server {listen 80;server_name rubygems.org;location / {proxy_pass http://rubygems.org;proxy_redirect off;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}}server {listen 80;server_name production.cf.rubygems.org;location / {proxy_pass http://production.cf.rubygems.org;proxy_redirect off;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_cache RUBYGEMS;proxy_cache_valid 200 1d;proxy_cache_use_stale error timeout invalid_header updatinghttp_500 http_502 http_503 http_504;}}server {listen 80;server_name production.s3.rubygems.org;location / {proxy_pass http://production.s3.rubygems.org;proxy_redirect off;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_cache RUBYGEMS;proxy_cache_valid 200 1d;proxy_cache_use_stale error timeout invalid_header updatinghttp_500 http_502 http_503 http_504;}}server {listen 443;server_name rubygems.org;location / {proxy_pass https://rubygems.org;proxy_redirect off;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}ssl on;ssl_certificate /etc/nginx/conf/server.crt;ssl_certificate_key /etc/nginx/conf/server.key;ssl_session_timeout 5m;ssl_protocols SSLv2 SSLv3 TLSv1;ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;ssl_prefer_server_ciphers on;}50.93.202.* rubygems.org50.93.202.* production.cf.rubygems.org50.93.202.* production.s3.rubygems.org#生成SSl证书, 这个是在centos下的情况 #openssl genrsa -out server.key 2048 #openssl req -new -x509 -key server.key -out server.crt -days 1095
几乎每次都会让新人安装ROR环境,几乎每次新人安装都会出现错误,几乎每次错误都是一样的。所以,为了节省我的生命,请各位新人在安装前仔细查看本文档。谢谢!
1. 安装 ubuntu server 版本,安装的时候不要选择 LAMP server.
2. 安装Mysql。
3. 安装 REE 环境。
4. 安装 Passenger 软件。
参考资料:
在ubuntu上搭建基于ree+nginx+passenger的rails3环境
http://www.yangzhiping.com/tech/ubuntu-ree-nginx-passenger-rails3.blog.html
问题1:
当安装好Passenger和Nginx后,你可能会建立第一个Rails应用程序
rake db:create
rails generate scaffold blog title:string body:text
rake db:migrate
然后,你可能会到浏览器中看结果 http://localhost:3000/blogs
不幸的是报错:We’re sorry, but something went wrong
问题在哪儿呢?
nginx的passenger模块默认是生产模式,如果是在本机进行开发,请更改。示范如下:
server {
listen 80;
server_name www.yourhost.com;
root /users/ouyang/projects/psykeys/public; # <--- be sure to point to 'public'!
passenger_enabled on;
rails_env development; #切记加入这一行
}