在Rails中将开发模式转换为生产模式时,我该怎么办?

时间:2013-10-09 16:25:15

标签: ruby-on-rails ruby ruby-on-rails-3

我正在使用Rails 3。

环境

Mac:Nginx + Passenger 4.0 + Ruby 2.0(RVM)

在Mac下,我可以在开发模式下(通过rails服务器)运行我的应用程序,

但是当我运行nginx时,它会显示错误。并且即使我运行bundle install

也无法工作
git://github.com/rweng/jquery-datatables-rails.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)

在另一个环境中,Ubuntu。

当我将应用程序从开发模式运行到生产模式时,我也遇到了一些问题。

RAILS_ENV =生产包exec rake资产:预编译

我完全不知道,我不认为这是css问题?

也许它没有安装一些宝石或在生产模式下做一些预先要求的工作

请给我一些提示,非常感谢

rake aborted!
Invalid CSS after "background-color: ": expected expression (e.g. 1px, bold), was "#white;"
  (in /Volumes/COMMON/Dropbox/rails/zeus/app/assets/stylesheets/application.css)
(sass):1738
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/scss/parser.rb:1145:in `expected'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/script/lexer.rb:199:in `expected!'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/script/parser.rb:471:in `assert_expr'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/script/parser.rb:49:in `parse'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/scss/parser.rb:1021:in `sass_script'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/scss/parser.rb:881:in `value!'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/scss/parser.rb:858:in `declaration'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/scss/parser.rb:581:in `block in declaration_or_ruleset'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/scss/parser.rb:1121:in `call'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/scss/parser.rb:1121:in `rethrow'
/Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.2.10/lib/sass/scss/parser.rb:591:in `declaration_or_ruleset'

nginx设置

 18     passenger_root /Users/poc/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.18;
 19     passenger_ruby /Users/poc/.rvm/wrappers/ruby-2.0.0-p247/ruby;

2 个答案:

答案 0 :(得分:0)

我说你的命令行Ruby是RVM版本,但你没有让Passenger知道你的RVM ruby​​,所以它使用默认的系统Ruby。从这里开始:http://rvm.io/integration/passenger检查您是否正确配置了Passenger和Apache以使用正确的Ruby。

答案 1 :(得分:0)

  

git://github.com/rweng/jquery-datatables-rails.git(在主站)没有签出。请运行bundle install(Bundler :: GitError)

尝试运行bundle install --deployment

  耙子流产了!   “background-color:”后的CSS无效:期望的表达式(例如1px,粗体)是“#white;”     (在/Volumes/COMMON/Dropbox/rails/zeus/app/assets/stylesheets/application.css中)   (SASS):1738

尝试background-color: white;background-color: #FFF;