0

GIT を使用して Heroku に Rails アプリをデプロイしようとしています。関連すると思われるstackoverflowで見つけたすべてのソリューションを適用しました。

これが私がやったことです:

ステップ 1: 以下は、取得したコマンドと結果です。

Hesham@HESHAM-PC /c/rails_projects/first_app (Hesh1)

$ git push heroku1 master

Enter passphrase for key '/c/Users/Hesham/.ssh/id_rsa':
Counting objects: 77, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (55/55), done.
Writing objects: 100% (77/77), 27.15 KiB, done.
Total 77 (delta 8), reused 71 (delta 6)

-----> Heroku receiving push  
-----> Ruby/Rails app detected  
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done  
-----> Configure Rails 3 to disable x-sendfile
       Installing rails3_disable_x_sendfile... done  
-----> Configure Rails to log to stdout
       Installing rails_log_stdout... done  
-----> Gemfile detected, running Bundler version 1.0.7
       Unresolved dependencies detected; Installing...  
       Using --without development:test  
       Windows Gemfile.lock detected, ignoring it.  
       You have modified your Gemfile in development but did not check
       the resulting snapshot (Gemfile.lock) into version control  

       You have added to the Gemfile:
       * source: rubygems repository https://rubygems.org/
       * rails (= 3.2.3)
       * sqlite3
       * sass-rails (~> 3.2.3)
       * coffee-rails (~> 3.2.1)
       * uglifier (>= 1.0.3)
       * jquery-rails
       FAILED: http://devcenter.heroku.com/articles/bundler
 !     Heroku push rejected, failed to install gems via Bundler

To git@heroku.com:fierce-mountain-7869.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:fierce-mountain-7869.git'

Hesham@HESHAM-PC /c/rails_projects/first_app (Hesh1)

STEP2: 上記の結果が得られたら、次を実行しました。

Hesham@HESHAM-PC /c/rails_projects/first_app (Hesh1)

$ bundle update

You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.

You have added to the Gemfile:
* source: rubygems repository https://rubygems.org/
* rails (= 3.2.3)
* sqlite3
* sass-rails (~> 3.2.3)
* coffee-rails (~> 3.2.1)
* uglifier (>= 1.0.3)
* jquery-rails

Hesham@HESHAM-PC /c/rails_projects/first_app (Hesh1)

STEP3: 私はアドバイスに従い、これを実行しました:

Hesham@HESHAM-PC /c/rails_projects/first_app (Hesh1)

$ bundle install --no-deployment

Using rake (0.9.2.2)  
Using i18n (0.6.0)  
Using multi_json (1.2.0)  
Using activesupport (3.2.3)  
Using builder (3.0.0)  
Using activemodel (3.2.3)  
Using erubis (2.7.0)  
Using journey (1.0.3)  
Using rack (1.4.1)  
Using rack-cache (1.2)  
Using rack-test (0.6.1)  
Using hike (1.2.1)  
Using tilt (1.3.3)  
Using sprockets (2.1.2)  
Using actionpack (3.2.3)  
Using mime-types (1.18)  
Using polyglot (0.3.3)  
Using treetop (1.4.10)  
Using mail (2.4.4)  
Using actionmailer (3.2.3)  
Using arel (3.0.2)  
Using tzinfo (0.3.33)  
Using activerecord (3.2.3)  
Using activeresource (3.2.3)  
Using coffee-script-source (1.2.0)  
Using execjs (1.3.0)  
Using coffee-script (2.2.0)  
Using rack-ssl (1.3.2)  
Using json (1.6.6)  
Using rdoc (3.12)  
Using thor (0.14.6)  
Using railties (3.2.3)  
Using coffee-rails (3.2.2)  
Using jquery-rails (2.0.2)  
Using bundler (1.1.3)  
Using rails (3.2.3)  
Using sass (3.1.15)  
Using sass-rails (3.2.5)  
Using sqlite3 (1.3.5)  
Using uglifier (1.2.4)  
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Hesham@HESHAM-PC /c/rails_projects/first_app (Hesh1)

STEP4: 私はまだ同じ結果を得ています:

Hesham@HESHAM-PC /c/rails_projects/first_app (Hesh1)

$ git push heroku1 master

Enter passphrase for key '/c/Users/Hesham/.ssh/id_rsa':
Counting objects: 77, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (55/55), done.
Writing objects: 100% (77/77), 27.15 KiB, done.
Total 77 (delta 8), reused 71 (delta 6)

-----> Heroku receiving push  
-----> Ruby/Rails app detected  
-----> Detected Rails is not set to serve static_assets  
       Installing rails3_serve_static_assets... done  
-----> Configure Rails 3 to disable x-sendfile  
       Installing rails3_disable_x_sendfile... done  
-----> Configure Rails to log to stdout  
       Installing rails_log_stdout... done  
-----> Gemfile detected, running Bundler version 1.0.7  
       Unresolved dependencies detected; Installing...  
       Using --without development:test  
       Windows Gemfile.lock detected, ignoring it.  
       You have modified your Gemfile in development but did not check
       the resulting snapshot (Gemfile.lock) into version control  

       You have added to the Gemfile:
       * source: rubygems repository https://rubygems.org/
       * rails (= 3.2.3)
       * sqlite3
       * sass-rails (~> 3.2.3)
       * coffee-rails (~> 3.2.1)
       * uglifier (>= 1.0.3)
       * jquery-rails
       FAILED: http://devcenter.heroku.com/articles/bundler
 !     Heroku push rejected, failed to install gems via Bundler

To git@heroku.com:fierce-mountain-7869.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:fierce-mountain-7869.git'

Hesham@HESHAM-PC /c/rails_projects/first_app (Hesh1)

git add Gemfile.lockまた、 and を使用して Gemfile と Gemfile.lock を追加し、.gitignoregit add Gemfileにそれらのいずれも記載されていないことを確認しました

Heroku に正常にデプロイするには、他に何を試すことができますか?

4

1 に答える 1

1

これは、開発グループであっても、Heroku が Gemfile で条件を許可していないためです。

http://www.johnplummer.com/rails/heroku-error-conditional-rbfsevent-gem.html

于 2014-05-06T21:22:28.877 に答える