title: UnhandledPromiseRejectionWarning: Error: The contract code couldn't be stored, please check your gas limit
body: <p>I am trying to deploy my simple solidity smart contract onto the Rinkeby Network but I keep getting the error:</p>
  
  <blockquote>
    <p>UnhandledPromiseRejectionWarning: Error: The contract code couldn't be
    stored, please check your gas limit.</p>
  </blockquote>
  
  <p>My solidity code is simple</p>
  
  <pre><code>pragma solidity ^0.4.18; 
  
  contract Greetings{ 
    string public message; 
  
    function Greetings(string initialMessage) public{ 
      message = initialMessage;
    }  
  
    function setMessage(string newMessage) public {
      message = newMessage;
    }  
  }
  </code></pre>
  
  <p>and my deploy script is:</p>
  
  <pre><code>const HDWalletProvider = require('truffle-hdwallet-provider'); 
  const Web3 = require('web3');
  const { interface,bytecode} = require('./compile');
  
  const provider = new HDWalletProvider(  
    'twelve word mnemonic...', 
    'https://rinkeby.infura.io/GLm6McXWuaih4gqq8nTY'    
  );
  
  const web3 = new Web3(provider);
  
  const deploy = async () =&gt; {
      accounts = await web3.eth.getAccounts(); 
  
      console.log('attempting to deploy from account',accounts[0]);
  
      const result = await new web3.eth.Contract(JSON.parse(interface)) 
        .deploy({data:bytecode, arguments:['Hello World']})      
        .send({from: accounts[0], gas:'1000000'});                              
  
      console.log('Contract deployed to', result.options.address); 
  };
  
  deploy();
  </code></pre>
  
  <p>Funny thing is, I used to be able to deploy successfully, but when i created a new project and re did the same code, i get this error now. Please help!</p>