LinuxDeployRails3withRuby1.9.2(5)FixtheErrorMessages

1.Sprockets::Environment#pathisdeprecated

wehave2waystosolvethis,itisharmlesswarningmessage

onewayistoupgradeourrailsfromrc5torc8.

>geminstallrails-v=3.1.0.rc8

>viGemfile

gem'rails','3.1.0.rc8'

>bundleupdate

theotherwayistoputthisgem'sprockets','2.0.0.beta.15'intoourGemfile.

>bundleupdatesprockets

2.Insecureworldwritabledir

/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:Insecureworldwritabledir/home/luohua/.rvm/rubies/ruby-1.9.2-p290/bininPATH,mode040777

>sudochmodgo-x-R/home/luohua/.rvm/rubies/ruby-1.9.2-p290/bin

>sudochmodgo-w~/.rvm

3.somethingwentwrong

Icanseesomemessageonthepagesasfollow:

We'resorry,butsomethingwentwrong.

We'vebeennotifiedaboutthisissueandwe'lltakealookatitshortly.

checktheprojectlogdirectoryandtheproduction.log

StartedGET"/project"forxxx.xxx.xxx.xxxat2011-09-0108:11:22+0800

ProcessingbyHomeController#indexasHTML

Renderedhome/index.html.erb(333.5ms)

Completed500InternalServerErrorin549ms

ActionView::Template::Error(InvalidCSSafter"...tYaHei,SimHei":expected"{",was";}"

(in/opt/work/projectname/app/assets/stylesheets/application.css)):

5:<linkhref="/assets/styles.css"type="text/css"rel="stylesheet"/>

6:<linkhref="/assets/IE.css"type="text/css"rel="stylesheet"/>

7:<scripttype="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'

Thatisbecauseofthe'sprockets'version.Ihatethisandredhat4.Ijustchangetorc8way,butthisproblemstillthere.

Icleanupallthedirectory,anddownloadmyprojectagain.Everythingisfinethen.IthinkImaybenefitfromupdatethesystemtorc8,andwithoutanythingchangesinGemfile.Sojustupgradethesystem,butdonotchangeyourGemfile,justusetheoldoneasfollow:

gem'rails','3.1.0.rc5'

#BundleedgeRailsinstead:

#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.Howtomakecommentsinerbfiles

Thisisnotdeploymentissue,butdevelopmentissue.Ifwewanttomakelargecommentsinerbfiles,wecandolikethis:

<%iffalse%>

balababalalalala

blablalalalalalalalalaladkala

<%end%>

references:

1

http://stackoverflow.com/questions/7238194/sprocketsenvironmentpath-is-deprecated

http://stackoverflow.com/questions/7130010/rails-3-1-0-assets-folder-not-rendering-sprocketsenvironmentstatic-root-is-de

3

https://github.com/chriseppstein/compass/issues/337

http://stackoverflow.com/questions/6115015/how-does-one-load-a-css-framework-in-rails-3-1