2012-04-06 69 views
1

我在安裝carrierwave並嘗試設置rackspace之前,我的應用在heroku上完全正常工作。我遵循了在寶石上提供的說明,但它並沒有幫助我設置我的應用程序。無法通過heroku與Rackspace配合使用carrierwave

我在heroku上託管我的網站,我有一個rackspace cloudfile帳戶,現在我正在使用載波。 config>初始化器carrierwave。

我設置初始化:

CarrierWave.configure do |config| 
    config.fog_credentials = { 
    :provider   => 'Rackspace', 
    :rackspace_username => 'my_id', 
    :rackspace_api_key => 'my_api_key' 
    } 


config.fog_directory = 'karet' 
    config.fog_host = "http://c000000.cdn.rackspacecloud.com" 
end 

應用程序上傳者? image_uploader.rb

包括鏈輪::助手:: RailsHelper 包括鏈輪::助手:: IsolatedHelper

#選擇使用什麼樣的存儲空間用於此上傳: #存儲:文件存儲 :霧

#覆蓋上傳文件將被存儲的目錄。 #這對於意欲被安裝上傳一個合理的默認: DEF store_dir 「上傳/#{model.class.to_s.underscore} /#{mounted_as}/{#} model.id」 端

我gettingg以下錯誤消息時,我嘗試通過瀏覽器來訪問我的HAP:

::的ActionView ::模板錯誤(不預編譯):

30:     <tr> 
    31:     <td> 

    32:       <% if karretlink.link == "" %> 
    33:        <%= image_tag(karretlink.link) %> 
    34:       <% else %> 
    35:        <% if karretlink.kind == 'video' %> 
    36:         <%= youtube_preview_embed(karretlink.link) %> 
    app/views/karretlinks/index.html.erb:33:in `block in _app_views_karretlinks_index_html_erb___2945645007174033048_34354840' 
    app/views/karretlinks/index.html.erb:29:in `each' 
    app/controllers/karretlinks_controller.rb:16:in `index' 

    app/views/karretlinks/index.html.erb:29:in `_app_views_karretlinks_index_html_erb___2945645007174033048_34354840' 
cache: [GET /] miss 
+0

我修復了這個問題。我在Rackspace上創建了一個文件夾'karat',然後我預編譯了我的資產,現在它工作正常。 – Richardsondx 2012-04-22 20:36:38

回答

0

我解決了這個問題。我在Rackspace上創建了一個文件夾'karat',然後我預編譯了我的資產,現在它工作正常。