2012-05-01 64 views
1

試圖在Rails 2.3應用程序運行鏈輪2 ...鏈輪2使用Rails 2.3

在pivotallabs.com

require 'config/environment' if !defined?(Rails) || !Rails.initialized? 
require 'sprockets' 

unless Rails.env.production? 
map '/assets' do 
    sprockets = Sprockets::Environment.new 
    sprockets.append_path 'app/assets/images' 
    sprockets.append_path 'app/assets/javascripts' 
    sprockets.append_path 'app/assets/stylesheets' 

    Sprockets::Helpers.configure do |config| 
    config.environment = sprockets 
    config.prefix  = "/assets" 
    config.digest  = false 
    end 

    run sprockets 
    end 
end 

map '/' do 
    use Rails::Rack::LogTailer unless Rails.env.test? 
    use Rails::Rack::Debugger unless Rails.env.test? 
    use Rails::Rack::Static 
    run ActionController::Dispatcher.new 
end 
根據引導安裝寶石和config.ru實施在此之後

然後我創建了應用程序/資產,並將javascript,圖像和樣式表目錄從公開並移動到應用程序/資產中。內部應用程序/資產/ Java腳本/ application.js中的我:

//= require_tree . 

內部應用程序/資產/樣式表/ application.css的我:

/* ... 
*= require_self 
*= require_tree . 
*/ 

當然,在佈局和我有:

<%= stylesheet_link_tag "assets/application" %> 
<%= javascript_include_tag "assets/application" %> 

我的配置中有些東西丟失了,我的資產都沒有顯示出來。有小費嗎?

回答