$ rake assets:precompile
rake aborted!
could not connect to server: Network is unreachable
    Is the server running on host "192.168.163.70" and accepting
    TCP/IP connections on port 5432?

(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/usr/local/Cellar/ruby/1.9.3-p0/bin/ruby /...]

So I'm trying to precompile assets on my development box. For some reason it tries to connect to the production database (192.168.163.70) and when it fails to do so, it aborts.

Why does it do that and how can I solve the problem?

有帮助吗?

解决方案

I had the following line in one of my Rake task files

require File.expand_path(File.join(File.dirname(__FILE__), '../..', 'config', 'environment'))

Removing it solved the problem.

其他提示

check your RAILS_ENV, it must be set to production at the moment.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top