$ 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 /...]
所以我想在我的开发盒上预编译资产。出于某种原因,它试图连接到生产数据库(192.168.163.70),并且当它不能这样做时,它会中止。rake资产:预编译尝试连接到生产数据库?
它为什么这样做,我该如何解决这个问题?
即使在我的项目中没有rake任务,我也有同样的问题。在预编译资产时,耙子坚持连接到生产数据库。我可以通过更改database.yml来将其生产指向dev数据库来暂时解决此问题,但这样可以轻松地将指向指向错误的数据库。有更好的解决方案 – 2012-05-10 14:24:21
我想尝试调试并找到导致资产预编译加载生产配置的原因。不幸的是,我没有更好的建议。 – randomguy 2012-05-11 12:38:10