在部署到 Ubuntu 的过程中,遇到一个奇怪的问题,搜索了半天,网上的解决方案都不行,只能来求助了。 问题现象: 在 windows 开发的,windows 上一切正常; 在页面上一直显示:We're sorry, but something went wrong.
日志显示:
Started GET "/" for 61.135.169.86 at 2014-01-07 17:28:15 +0800
Processing by WelcomeController#index as HTML
Rendered welcome/index.html.erb within layouts/application (0.1ms)
Completed 500 Internal Server Error in 10ms
ActionView::Template::Error (application.css isn't precompiled):
4: <meta name="viewport" content="width=device-width, initial-scale=1.0">
5: <title><%= content_for?(:title) ? yield(:title) : "Rails3 Bootstrap Devise Cancan" %></title>
6: <meta name="description" content="<%= content_for?(:description) ? yield(:description) : "Rails3 Bootstrap Devise Cancan" %>">
7: <%= stylesheet_link_tag "application", :media => "all" %>
8: <%= javascript_include_tag "application" %>
9: <%= csrf_meta_tags %>
10: <%= yield(:head) %>
app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__256043867756328300_38121320'
相关的 gem file:
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'bootstrap-sass'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
试图解决:一直碰到 File to import not found or unreadable: bootstrap-responsive. 的问题
# RAILS_ENV=development bundle exec rake assets:precompile
(in /data/wwwsite/kkus)
/usr/local/rvm/rubies/ruby-1.9.3-p484/bin/ruby /usr/local/rvm/gems/ruby-1.9.3-p484/bin/rake assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets
rake aborted!
File to import not found or unreadable: bootstrap-responsive.
Load paths:
Sass::Rails::Importer(/data/wwwsite/tusulicai/app/assets/stylesheets/bootstrap_and_overrides.css.scss)
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/bootstrap-sass-3.0.3.0/vendor/assets/stylesheets
(in /data/wwwsite/tusulicai/app/assets/stylesheets/bootstrap_and_overrides.css.scss)
/data/wwwsite/tusulicai/app/assets/stylesheets/bootstrap_and_overrides.css.scss:3
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sass-3.2.13/lib/sass/tree/import_node.rb:67:in `rescue in import'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sass-3.2.13/lib/sass/tree/import_node.rb:45:in `import'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sass-3.2.13/lib/sass/tree/import_node.rb:28:in `imported_file'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sass-3.2.13/lib/sass/tree/import_node.rb:37:in `css_import?'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sass-3.2.13/lib/sass/tree/visitors/perform.rb:217:in `visit_import'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sass-3.2.13/lib/sass/tree/visitors/base.rb:37:in `visit'
求解决方案?谢谢