@テク野路ジーロード

配信タグシェアリングシステムpickvyを開発、運営開始。最近は、Googleアナリティクスを研究中

Sqaleでアプリ新規作成後に発生したビルドエラーと解決策一覧

今回、Sqaleでアプリを新規作成して、ファイルをアップロードしたんだけど、
ビルドエラーが出まくった。備忘録として残しておきます。
ひたすら、エラー文と解決策を列挙していきます。

f:id:sunday150:20161008005501p:plain

目次

  1. rakeのバージョンが入っていない!
  2. 指定されたmime-typesはrubyのバージョンが2以上じゃないとダメ
  3. 指定されたmime-typesのバージョンは2.6だけど、今すでに3.1だよ!
  4. 有効化させたrakeのバージョンがGemfileに記載れているのと違うよ!
  5. Deviseのシークレットキーがないよ!

それでは、始まり始まり♪♪♪

1.rakeのバージョンが入っていない!

  • エラー文
    Could not find rake-11.2.2 in any of the sources
    Run `bundle install` to install missing gems.

  • 解決策

    Gemfileにrakeを記述する。今回は以下と記述
    gem 'rake', '11.2.2'

2.指定されたmime-typesはrubyのバージョンが2以上じゃないとダメ!

  • エラー文
    Gem::InstallError: mime-types-data requires Ruby version >= 2.0.
    An error occurred while installing mime-types-data (3.2016.0521), and Bundler cannot continue.
    Make sure that `gem install mime-types-data -v '3.2016.0521'` succeeds before bundling.

  • 解決策
    currentディレクトリ直下=Gemfileと同じ階層に、.ruby-versionファイルを作成する。
    これで、rubyのバージョンを切り替えることが可能になる。
    ファイルの中身は「2.3.0」。これだけでOK
    Sqale - Ruby 2.0 を使う方法 Mac 編

3.指定されたmime-typesのバージョンは2.6だけど、今すでに3.1だよ!

 

4.有効化させたrakeのバージョンがGemfileに記載れているのと違うよ!

  • エラー文
    $ rake db:migrate
    rake aborted!
    Gem::LoadError: You have already activated rake 11.1.2, but your Gemfile requires rake 11.2.2. Prepending `bundle exec` to your command may solve this.
    /home/sqale/current/config/boot.rb:3:in `<top (required)>'
    /home/sqale/current/config/application.rb:1:in `<top (required)>'
    /home/sqale/current/Rakefile:4:in `<top (required)>'
    LoadError: cannot load such file -- bundler/setup
    /home/sqale/current/config/boot.rb:3:in `<top (required)>'
    /home/sqale/current/config/application.rb:1:in `<top (required)>'
    /home/sqale/current/Rakefile:4:in `<top (required)>'
    (See full trace by running task with --trace)

  • 解決策
    bundle exec rake db:migrate
    こちらを参考に実施。まぁ、警告文の通りなんだけどね。
    「rake db:migrate」コマンドで「rake aborted」になったら - Qiita
    原因や、このコマンドの意味など詳細は今後確認していきたい。

5.Deviseのシークレットキーがないよ!

  • エラー文
    rake aborted!
    Devise.secret_key was not set. Please add the following to your Devise initializer:

  • 解決策
    単純に、エラー文内に記載されている以下を(approot)/config/devise.rb へ追記。
    config.secret_key ='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

 

以上。ご参考にする方はいらしたら、どうぞ。