Linux Deploy Rails3 with Ruby1.9.2(5)Fix the Error Messages

来源:未知 责任编辑:智问网络 发表时间:2013-11-04 19:51 点击:

Linux Deploy Rails3 with Ruby1.9.2(5)Fix the Error Messages

1. Sprockets::Environment#path is deprecated
we have 2 ways to solve this, it is harmless warning message
one way is to upgrade our rails from rc5 to rc8.
>gem install rails -v=3.1.0.rc8
>vi Gemfile
gem 'rails', '3.1.0.rc8'
>bundle update
the other way is to put this gem 'sprockets', '2.0.0.beta.15' into our Gemfile.
>bundle update sprockets

2. Insecure world writable dir
/home/luohua/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9/gems/passenger-3.0.8/lib/phusion_passenger/platform_info/operating_system.rb:98: warning: Insecure world writable dir /home/luohua/.rvm/rubies/ruby-1.9.2-p290/bin in PATH, mode 040777

>sudo chmod go-x -R /home/luohua/.rvm/rubies/ruby-1.9.2-p290/bin
>sudo chmod go-w ~/.rvm

3. something went wrong
I can see some message on the pages as follow:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.

check the project log directory and the production.log

Started GET "/project" for xxx.xxx.xxx.xxx at 2011-09-01 08:11:22 +0800
  Processing by HomeController#index as HTML
Rendered home/index.html.erb (333.5ms)
Completed 500 Internal Server Error in 549ms
ActionView::Template::Error (Invalid CSS after "...t YaHei, SimHei": expected "{", was ";}"
  (in /opt/work/projectname/app/assets/stylesheets/application.css)):
    5: <link href="/assets/styles.css" type="text/css" rel="stylesheet" />
    6: <link href="/assets/IE.css" type="text/css" rel="stylesheet" />
    7: <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    8: <%= stylesheet_link_tag    "application" %>
    9: <%= javascript_include_tag "application" %>
    10: <%= csrf_meta_tags %>
    11: <title>projectname</title>
  app/views/home/index.html.erb:8:in `_app_views_home_index_html_erb___579589567_96323830'

That is because of the 'sprockets' version. I hate this and redhat4. I just change to rc8 way, but this problem still there.

I clean up all the directory, and download my project again. Everything is fine then. I think I may benefit from update the system to rc8, and without anything changes in Gemfile. So just upgrade the system, but do not change your Gemfile, just use the old one as follow:
gem 'rails', '3.1.0.rc5'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

#gem 'sqlite3'

#gem 'mysql', '2.8.1'

gem 'mysql2'

gem 'execjs'

#gem 'therubyracer'

gem 'libv8'

4. How to make comments in erb files
This is not deployment issue, but development issue. If we want to make large comments in erb files, we can do like this:
<% if false %>
            balababalalalala
blablalalalalalalalalaladkala   
<% end %>


作者“快马扬鞭须努力!”
 

    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>

    推荐热点

    • /etc/fstab 详解
    • nginx主主集群
    •  LVS-NAT和LVS-DR模式的实现详解
    •  RHCE考试之磁盘配额
    • 学习笔记:ACL详解
    • suse linux双网卡双网关配置
    •  LVM逻辑卷管理器
    •  Nginx主主负载均衡架构
    • ubuntu学习Mysql

    快速直达

    操作系统导航

    LinuxWindows虚拟机
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1