2014-01-27 64 views
1

我正在嘗試爲我的CSS使用波旁寶石。它工作在我的發展,但是當我部署到登臺時,我嘗試訪問主頁它打破:Rails 3 +波旁文件:導入未找到或無法讀取的文件:bourbon/_bourbon

ActionView::Template::Error (File to import not found or unreadable: bourbon. 
    Load path: /usr/local/www/lal-staging/releases/20140127202905 
     (in /usr/local/www/lal-staging/releases/20140127202905/app/assets/stylesheets/application.css.scss)): 
     2: <html> 
     3: <head> 
     4:  <title>Lal</title> 
     5:  <%= stylesheet_link_tag "application", :media => "all" %> 
     6:  
     7:  <%= csrf_meta_tags %> 
     8: 
     app/assets/stylesheets/application.css.scss:18 
     app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__764987263561831936_25446520' 

我使用Capistrano的部署和乘客服務器應用程序。我嘗試了第二次部署,結果是一樣的。我也試過重啓乘客與sudo touch tmp/restart.txt

這裏是我的Gemfile:

source 'https://rubygems.org' 

gem 'rails', '3.2.13' 

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

gem 'mysql2' 
gem 'mysql' 
gem 'devise' 
gem 'cancan' 
gem 'exception_notification' 
gem 'execjs' 
gem 'therubyracer', :platforms => :ruby 
gem 'rolify' 
gem 'paperclip', "~> 3.0" 
gem 'rails-i18n' 
gem 'prawn_rails' 
# gem 'pdfkit' 
gem "slugged", "~> 2.0.0" 
gem 'ransack' 
gem 'will_paginate', '~> 3.0.0' 
gem 'font-awesome-sass' 
gem "twitter-bootstrap-rails" 
gem 'bluecloth' 
gem 'nokogiri' 
gem 'bourbon' 
gem 'neat' 
gem 'sidekiq' 

# 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' 

group :development, :test do 
    gem 'debugger', '1.6.1' 
    gem 'ruby-debug-base19x', '>= 0.11.30.pre12' 
    gem 'ruby-debug-ide', '>= 0.4.18' 
    gem 'rspec-rails' 
    gem "capybara" 
    gem 'cucumber-rails', :require => false 
    gem 'database_cleaner'   
    gem 'factory_girl'   
    gem 'factory_girl_rails' 
    gem 'shoulda-matchers' 
    gem 'wkhtmltopdf-binary' 
    gem 'selenium-webdriver' 
    gem 'better_errors' 
    gem 'binding_of_caller' 
    # Deploy with Capistrano 
    gem 'capistrano' 
end 

group :test do 
    gem 'webmock' 
end 

# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

# Use unicorn as the app server 
# gem 'unicorn' 

Capistrano的看起來像它做成功bundle install。所以我不知道什麼是錯的。

任何幫助,將不勝感激。

回答

1

您是否在資產組內有gem 'bourbon'?嘗試將其移出資產組並重試。

另一個問題可能是,capistrano未執行rake assets:precompile。如果你想懶散地編譯你的資產在舞臺上添加這個到你的應用程序.rb

if defined?(Bundler) 
    # If you precompile assets before deploying to production, use this line 
    Bundler.require *Rails.groups(:assets => %w(development test staging)) 
    # If you want your assets lazily compiled in production, use this line 
    # Bundler.require(:default, :assets, Rails.env) 
end 
相關問題