2012-06-17 76 views
1

我克隆此https://github.com/xaviershay/enki,做了以下修改:恩基部署的Heroku - 與資產問題預編譯

我的Gemfile現在看起來是這樣的:

source 'https://rubygems.org' 

gem 'rails', '3.2.6' 

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

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
end 

group :production do 
    gem 'pg' 
end 

group :development do 
    gem 'mysql2', '~> 0.3.11' 
end 

platforms :jruby do 
    gem 'activerecord-jdbcsqlite3-adapter' 
    gem 'trinidad' 
    gem 'jruby-openssl' 
end 

gem 'jquery-rails' 

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

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'ruby-debug' 

# Bundle the extra gems: 
gem 'RedCloth', '~> 4.2.9', :require => 'redcloth' 
gem 'ruby-openid', :require => 'openid' 
gem 'rack-openid', :require => 'rack/openid' 
gem 'aaronh-chronic', :require => 'chronic' # Fixes for 1.9.2 
gem 'coderay' 
gem 'lesstile' 
gem 'formtastic' 
gem 'will_paginate', '~> 3.0.2' 
gem 'exception_notification', '~> 2.5.2' 
gem 'open_id_authentication' 

# Bundle gems for the local environment. Make sure to 
# put test-only gems in this group so their generators 
# and rake tasks are available in development mode: 
group :test do 
    gem 'database_cleaner' 
    gem 'cucumber-rails', :require => false 
    gem 'cucumber-websteps', :require => false 
    gem 'factory_girl' 
    gem 'rspec' 
    gem 'nokogiri', '~> 1.5.0' 
    gem 'webrat' 
end 

group :development, :test do 
    gem 'rspec-rails' 
end 

而且我還修改了database.yml文件,以是這樣的:

development: 
    adapter: mysql2 
    database: myblog_development 
    username: root 
    password: 
    host: localhost 
test: 
    adapter: mysql2 
    database: myblog_test 
    username: root 
    password: 
    host: localhost 

我能夠檢查網站在我的地方,而是試圖將其部署到Heroku的,當我得到以下幾點:

-----> Writing config/database.yml to read from DATABASE_URL 
-----> Preparing app for Rails asset pipeline 
     Running: rake assets:precompile 
     rake aborted! 
     could not connect to server: Connection refused 
     Is the server running on host "127.0.0.1" and accepting 
     TCP/IP connections on port 5432? 
     Tasks: TOP => environment 
     (See full trace by running task with --trace) 
     Precompiling assets failed, enabling runtime asset compilation 
     Injecting rails31_enable_runtime_asset_compilation 
     Please see this article for troubleshooting help: 
     http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting 

我試圖做他們建議在最後一個網站,但仍然得到相同的錯誤。我錯過了什麼?

回答

3

在你的application.rb中的文件,加入這一行:

config.assets.initialize_on_precompile =假