うちのいぬ Tech Blog

Tech Blog of Uchinoinu/My dog

Werckerで "Bundler failing with index file .idx too small error" といったエラーが出た場合の対処

状況

普段Rails4系のアプリでWerckerをCIとして使っています。 WerckerはDocker版を使用しています。

そのBuild Stepで

Bundler failing with index file .idx too small error

といったエラーがたくさんでて、結果的に

Retry exceeds max retries

といったエラーでBuildが止まりました。

対応

このエラーは報告されていますが、まだ解決されていないようです。 ただ、対応としては、cacheを消せばいいとのこと。

実際消してやってみるとすんなりとおりました。

でも毎回消す必要が出てしまうので、werckerのstepに入れ込みたいです。

    - script:
        name: Clear bundle cache
        code: rm -rf /pipeline/cache/bundle-install/ruby/2.3.0/cache/bundler/git/*

↑のパスは各自のパスに直してください。

ただ、これをすることで CI での Load は上がるかもしれないとも言われています。(現在これといって問題は感じていませんが)

Git command for Deploy or PR merging

Diff of changed files

$ git diff --stat commit-new commit-old
$ git diff --stat --name-only commit-new commit-old
$ git diff --stat --ignore-blank-lines commit-new commit-old

Diff of content of file

$ git diff commit-old commit-new -- path/to/file

Show diff by a word with color

$ git diff --color-words  

Git Visibility

color

$ git config --global color.ui true

Log check

$ git log --graph --decorate --oneline

References

qiita.com

qiita.com

デプロイ前のログや差分をチェックするgitコマンド

変更したfileの抽出

$ git diff --stat commit-new commit-old
$ git diff --stat --name-only commit-new commit-old
$ git diff --stat --ignore-blank-lines commit-new commit-old

fileの変更差分

$ git diff commit-old commit-new -- path/to/file

差分を単語単位で色分けで表示する

$ git diff --color-words  

gitを見やすく

color

$ git config --global color.ui true

ログチェック

$ git log --graph --decorate --oneline

References

qiita.com

qiita.com

Links of Restful API(JSON) References

Japanese Here uchinoinu.hatenablog.jp

Guideline

Platform

Articles

Presentation

JSON API

JSON Schema

Restful API(JSON)の参考まとめ

Japanese here uchinoinu.hatenablog.jp

Guideline

Platform

Articles

Presentation

JSON API

JSON Schema

How to set initial selected tab

Japanese here uchinoinu.hatenablog.jp

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        let tabBar = self.window!.rootViewController as! UITabBarController
        tabBar.selectedIndex = 1 // Set index number which you want to select

        return true
    }

最初に選択されるTabを指定する方法

English here uchinoinu.hatenablog.jp

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        let tabBar = self.window!.rootViewController as! UITabBarController
        tabBar.selectedIndex = 1 // ここを指定したいTabのIndexにする

        return true
    }