1

私はherokuにディアスポラを展開しようとしていますが、ubuntu 14.04でRuby 2.0.0でレール4.1.8を使用していますが、展開中にこのエラーが発生しbundle updateました。

> ahmed@ahmed-desktop:~/diaspora$ git push -u heroku heroku:master
> Counting objects: 132081, done.
> Delta compression using up to 2 threads.
> Compressing objects: 100% (29619/29619), done.
> Writing objects: 100% (132081/132081), 91.87 MiB | 163.00 KiB/s, done.
> Total 132081 (delta 101146), reused 132070 (delta 101138)
> remote: Compressing source files... done.
> remote: Building source:
> remote:
> remote: -----> Deleting 6 files matching .slugignore patterns.
> remote: -----> Ruby app detected
> remote: -----> Compiling Ruby/Rails
> remote: -----> Using Ruby version: ruby-2.0.0
> remote: -----> Installing dependencies using 1.7.12
> remote:        Running: bundle install --without development:test --path
> vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
> remote:        You are trying to install in deployment mode after changing
> remote:        your Gemfile. Run `bundle install` elsewhere and add the
> remote:        updated Gemfile.lock to version control.
> remote:        You have deleted from the Gemfile:
> remote:        * mysql2 (= 0.3.16)
> remote:        Bundler Output: You are trying to install in deployment
> mode after changing
> remote:        your Gemfile. Run `bundle install` elsewhere and add the
> remote:        updated Gemfile.lock to version control.
> remote:
> remote:        You have deleted from the Gemfile:
> remote:        * mysql2 (= 0.3.16)
> remote:  !
> remote:  !     Failed to install gems via Bundler.
> remote:  !
> remote:
> remote:  !     Push rejected, failed to compile Ruby app
> remote:
> remote: Verifying deploy...
> remote:
> remote: !    Push rejected to reddodo.
> remote:
> To https://git.heroku.com/reddodo.git
>  ! [remote rejected] heroku -> master (pre-receive hook declined)
> error: failed to push some refs to 'https://git.heroku.com/reddodo.git'
4

2 に答える 2

0

問題は、heroku がそのままでは mysql をサポートしていないことだと思います。Postgres に切り替えるか、 ClearDBなどのアドオンを使用する必要があります。

更新:考え直して、おそらくこれです

Gemfile.lock に関して表示されるエラー メッセージは、Gemfile と Gemfile.lock が互いに一致していないことが原因である可能性があります。bundle install (または update) を最後に実行してから、Gemfile で何かを変更したようです。インストールをバンドルすると、Gemfile に加えた変更で Gemfile.lock が更新されます。

bundle install をローカルで実行し、チェックインして新しく更新された Gemfile.lock をソース管理してください。次に、デプロイしてみます。

編集: コメントで認識されているように、Gemfile の条件により、あるプラットフォームでは有効な Gemfile.lock が発生し、別のプラットフォームでは無効になりました。Gemfile でこれらのプラットフォーム依存の gem に :platform フラグを指定すると、非対称性が解決されます。

~エド・モーガン

于 2015-03-04T10:39:53.377 に答える