LinuxDeployRails3withRuby1.9.2 (5) FixtheErrorMessages

Source: Internet
Author: User
LinuxDeployRails3withRuby1.9.2 (5) FixtheErrorMessages1.Sprockets: Environment # pathisdeprecatedwehave2waystosolvethis, itisharmlesswarningmessageonewayis...

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_passion/ 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 at 08:11:22 + 0800
Processing by HomeController # index as HTML
Rendered home/index.html. erb (333.5 ms)
Completed 500 Internal Server Error in 549 ms
ActionView: Template: Error (Invalid CSS after "... t YaHei, SimHei": expected "{", was ";}"
(In/opt/work/projectname/app/assets/stylesheets/application.css )):
5:
6:
7:
8: <% = stylesheet_link_tag "application" %>
9: <% = javascript_include_tag "application" %>
10: <% = csrf_meta_tags %>
11:Projectname
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 'lib8'

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
Blablalalalalalalalalalaladkala
<% End %>


Author: "Quick Start must work hard !"
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.