2017-05-22 103 views
0

我无法迁移truffle init随附的标准合同。 Here's我做什么:松露迁移错误

truffle init 
truffle compile 
truffle migrate 

,这就是它生成时我初始化:

enter image description here

但是,当我迁移,下面的错误列表中显示:

Error: Invalid JSON RPC response: "" 
at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/errors.js:35:16) 
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:115:32) 
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18) 
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12) 
at XMLHttpRequest._onHttpRequestError (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:544:12) 
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:414:24) 
at emitOne (events.js:96:13) 
at ClientRequest.emit (events.js:188:7) 
at Socket.socketErrorListener (_http_client.js:309:9) 
at emitOne (events.js:96:13) 
+0

确保您testrpc服务器正在运行,并检查您的truffle.js配置有正确的端口和IP地址。 – webjunkie

+0

谢谢你,港口和地址是正确的我忘了testrpc之前这一切 – killezio

回答

2

As webjunkie评论:

  1. testrpc
  2. 检查truffle.js配置端口和IP设置为默认的“localhost:8545”
  3. truffle migrate
+0

谢谢,我忘了testrpc – killezio