将aws-s3部署到heroku,

时间:2016-10-23 20:38:32

标签: ruby-on-rails heroku amazon-s3

我在heroku网站上创建新公司没有问题。当我添加aws-s3来存储照片时,我开始遇到这个错误。

Paperclip::Error (Company model missing required attr_accessor for 'logo_image_file_name')

在我的架构中,我的公司表有logo_image_file_name,我的相应控制器有

params.require(:company).permit(:name, logo_image: 
[:logo_image_file_name, :logo_image_file_size, 
:logo_image_content_type, :logo_image_updated_at], :address...

我已经完成了heroku rake db:reset并播种了数据库。到目前为止,该错误仅发生在公司表单提交上。

1 个答案:

答案 0 :(得分:0)

尝试更新Heroku

在控制台/终端中运行以下行

<!DOCTYPE>
<html>
<head>
    <title>Could it be a sliver attack?</title>
    <link rel="stylesheet" src="stylesheet.css">
    <script src="isItSilver.js"></script>
</head>
<body>
    <h1>Could it be a sliver attack?</h1>
    <p>You can use this tool to calculate wether the attacking troops can carry enough silver to capture your castle. <br>If they dont then you can safely remove your troops let them take your resources and leave.</p>
    
    <fieldset>
        <legend>Your castle under attack is a:</legend>
        <p>
            <input id="yourcastle" type="radio" name="underattack" checked="checked"><label for="yourcastle">Castle</label>
            <input id="yourfort" type="radio" name="underattack"><label for="yourfort">Fortress</label>
    
        </p>
    </fieldset>
    <fieldset>
        <legend>Attacker Information</legend>
        <p>(if multiple players are attacking use the lowest players information)</p>
        <table>
            <tr>
                <td>
                    <input type="number" value="1" id="attackerCastlesNum"><label for="attackerCastlesNum">How many Castles does the attacker have?</label>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="number" value="0" id="attackerFortNum"><label for="attackerFortNum">How many Fortresses does the attacker have?</label>
                </td>
        
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend>Is land reform on?</legend>
        <p>
            <input id="landRefYes" type="radio" name="landRef"><label for="landRefYes">Yes, land reform is on</label>
            <input id="landRefNo" type="radio" name="landRef" checked="checked"><label for="landRefNo">No, land reform is not on</label>
            <br>
            Land reform means Castles & Fortresses cost 50% silver
        </p>
    </fieldset>
    <fieldset>
        <legend>How many troops are attacking?</legend>
        <p>Use the amount of troops that arrived before the first round. If any support has arrived add those troops to the troops that arrived before round one
        </p>
        <tabel>
            <tr>
                <td>Spearmen:</td>
                <td>
                    <input type="number" id="spearmanNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Swordsman:</td>
                <td>
                    <input type="number" id="swordsmanNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Berserker:</td>
                <td>
                    <input type="number" id="berserkerNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Archer:</td>
                <td>
                    <input type="number" id="archerNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Crossbowman:</td>
                <td>
                    <input type="number" id="crossbowmanNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Nordic Archer:</td>
                <td>
                    <input type="number" id="nordicArcherNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Armoured Horseman:</td>
                <td>
                    <input type="number" id="armouredHorsemanNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Lancer Horseman:</td>
                <td>
                    <input type="number" id="lancerHorsemanNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Axe Rider:</td>
                <td>
                    <input type="number" id="axeRiderNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Hand Cart:</td>
                <td>
                    <input type="number" id="handCartNum">
                </td>
            </tr>
            <br>
            <tr>
                <td>Ox Cart:</td>
                <td>
                    <input type="number" id="oxCartNum">
                </td>
            </tr>
        </tabel> 
    </fieldset>
    <button id="isItASilverAttack" onclick="enoughSilver()">Is It A Silver Attack?</button>
    <p id="answer"></p>
    <p>If the troops cant hold enough silver to capture your castle then you can move your troops out and let the attacker steal some of your resources. <span id="warning">Warning!</span> If reinforcments arrive then you must do this again </p>
    
</body>
</html>

面对同样的问题,并在更新后得到解决。