我无法推送到heroku。
这是我的heroku日志http://pastebin.com/M7q7qJ3x
错误发生在这里
-----> 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?
这是我的database.yml文件
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: postgresql
encoding: unicode
database: restaurant_development
pool: 5
username: judyngai
password:
host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
database: restaurant_test
pool: 5
username: judyngai
password:
host: localhost
production:
adapter: postgresql
encoding: unicode
database: restaurant_production
pool: 5
username: judyngai
password:
host: localhost
我应该将主机更改为“127.0.0.1”并添加一个端口吗? 这很奇怪。我不明白这一点。
这是另一个错误
Precompiling assets failed, enabling runtime asset compilation
我根本没碰过js,css文件。
在推送之前,我应该在本地“编译资产”吗?我对资产不太熟悉。
答案 0 :(得分:4)
在application.rb
或production.rb
添加
config.assets.initialize_on_precompile = true
答案 1 :(得分:0)
的Gemfile
添加此
gem 'sass', '3.2.13'
它为我工作。