无法通过heroku将carrierwave与Rackspace配合使用

时间:2012-04-06 09:50:04

标签: heroku rackspace

在我安装了carrierwave之前,我的应用程序在heroku上工作得很好,并尝试设置机架空间。我按照宝石上提供的说明进行操作,但它并没有帮助我设置我的应用程序。

我在heroku上托管我的网站,我有一个rackspace帐户,我现在正在使用运营商。 config>初始化载波。

我设置了初始化程序:

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

App Uploaders? image_uploader.rb

包括Sprockets :: Helpers :: RailsHelper    包括Sprockets :: Helpers :: IsolatedHelper

#选择要用于此上传器的存储空间类型:   #storage:文件    存储:雾

#覆盖将存储上载文件的目录。   #对于要安装的上传者,这是一个合理的默认值:   def store_dir     "上载/#{model.class.to_s.underscore} /#{mounted_as} / {#} model.id"   端

当我尝试通过浏览器访问我的机会时,我收到以下错误消息:

ActionView :: Template :: Error(isn' t precompiled):

    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

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。我在Rackspace上创建了一个文件夹'karat',然后我预编译了我的资产,它现在工作正常。