3

私は Heroku Dev Center についてかなりの調査を行ってきましたが、現在はコミュニティに助けを求めています。これが私の問題です。データベースを Heroku Cedar Stack にプッシュできません。Taps gem を使用して sqlite データベースを postgresql に移行しようとしています。展開する準備ができたら、次を実行します。

bundle install --without production
heroku run db:push

次の結果が得られます。

Running db:seed attached to terminal... up, run.17
sh: db:seed: not found
heroku run rake db:migrate

そして、移行を実行すると:

heroku run rake db:migrate

私は以下を取得します:

Running rake db:migrate attached to terminal... up, run.18
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/usr/local/lib/ruby/1.9.1/rake.rb:2367:in `raw_load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/local/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/local/bin/rake:31:in `<main>'

Heroku (git push heroku master) にプッシュするたびに、Gemfile の開発およびテスト グループ内にあるにもかかわらず、gem ファイルが sqlite3 gem をインストールしようとしているため、失敗します。次のコマンドを正常に実行した後でも、私の database.yml 運用環境は依然として sqlite アダプターを指しています。

heroku config:add BUNDLE_WITHOUT="test development" --app app_name_on_heroku

アイデアがありません。助けてください。役立つ場合は、gemfile、heroku ps、およびログの結果を投稿できます。

乾杯

更新: @John の指示に従った後、次の端末メッセージを受け取りました。

Sending schema
Schema:        100% |==========================================| Time: 00:00:07
Sending indexes
schema_migrat: 100% |==========================================| Time: 00:00:00
Sending data
4 tables, 6 records
schema_migrat:   0% |                                          | ETA:  --:--:--
Saving session to push_201111070749.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: LoadError: no such file to load -- sequel/adapters/

そして、次の警告:

["/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:tsk_requirerequire'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:in内のブロック内", "/app/.bundle/gems/ ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:72:block in check_requiring_thread'", "<internal:prelude>:10:in同期中'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20. 0/lib/sequel/core.rb:69:in check_requiring_thread'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:intsk_require'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb: 25:in adapter_class'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:54:inconnect'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:119:in connect'", "/app/lib/taps/db_session.rb:14:inconn'", "/app/lib /taps/server.rb:91:block in <class:Server>'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in呼び出し中' block in route'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:inroute_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:500:inブロック (2 レベル) in route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:inblock in route!'", 「/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in each'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:inroute!」、「/app/.bundle/gems/ruby/1.9. 1/gems/sinatra-1.0/lib/sinatra/base.rb:601:in dispatch!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:inblock in call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra /base.rb:566:invokeinstance_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:inのブロック内catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:399:incall'", "/app/.bundle/gems/ruby/1.9.1 /gems/rack-1.2.1/lib/rack/auth/basic.rb:25:in call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:inblock in call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:1005:insynchronize'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:incall'", "/home/heroku_rack/lib/static_assets.rb:9:in call'", "/home/heroku_rack/lib/last_access.rb:15:incall'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/ urlmap.rb:47:in block in call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:ineach'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in call'", "/home/heroku_rack/lib/date_header.rb:14:incall'", " /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:77:in call'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:76:inblock in pre_process'", "/app/.bundle/gems/ruby/ catch'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/ _ lib/thin/connection.rb:57:in process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:42:inreceive_data'", "/app/.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in run_machine'", "/app/.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:inrun'" 、「/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/backends/base.rb:57:のstart'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/server.rb:156:instart'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:inrun_command'", "/app/.bundle /gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:143:in run!'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/bin/thin:6:in'", "/usr/ruby1.9.2/bin/thin:19:in load'", "/usr/ruby1.9.2/bin/thin:19:in'"]

4

4 に答える 4

2

同様の問題がありました。Bundler の開発グループに SQLite gem を含め、Production グループに Postgres gem を含めました。Heroku は引き続き SQLite をインストールしようとします。

どうやら Cedar スタックは、特定のグループがないとバンドルをサポートしていないようです。https://devcenter.heroku.com/articles/bundler

注 - 当分の間、Cedar スタックは BUNDLE_WITHOUT をサポートしていません。

Gemfile.lock を実行し、Gemfile から SQLite gem をコメントアウトし、インストールを再バンドルし、新しい Gemfile と Gemfile.lock を git に追加して、Heroku にプッシュする必要がありました。また、SQLite は Taps の依存関係であるため、それもコメントアウトしました。

開発環境を起動したいときは、上記を逆にするだけです。

次回の開発ではPostgresを使用するだけです!

于 2012-04-06T17:53:59.677 に答える
1

まず、DB プッシュ コマンドは

heroku db:push

経由しないheroku run

ブランチをプッシュするための構文に至るまで、Sqliteの問題(おそらく?)を疑っています-ブランチをherokuにプッシュするには、あなたがしなければならない

git push heroku branchname:master

これは、heroku リモートの master ブランチにプッシュするということです。git push heroku branchnameHeroku は master ブランチのみをデプロイするため、実際に何もデプロイしていないので、コードに変更を加えてプッシュすることはできますが、実際にはデプロイされたコードには影響しません。メッセージが表示される理由は説明されていませんがNo rakefile found

于 2011-11-07T08:54:20.613 に答える
1

私は同じ問題を抱えていましたが、実際に役立つのは2つのことです

  1. git リポジトリを完全に消去してから、最初からやり直します - git init, git add 。次に git stage 。次に、 git commit -m "ここに置きたいものは何でも"。その後、アプリを破棄して再度作成し、db:migrate を含むすべての手順を実行します。次のようにアプリを作成してください: heroku create --stack cedar

  2. このリンクを確認してください https://github.com/carlhuda/bundler/blob/master/ISSUES.md

于 2011-11-26T02:44:30.450 に答える
0

https://devcenter.heroku.com/articles/rails3#deploy-your-application-to-herokuで説明されているように、コードをデプロイするだけです

heroku create
git push heroku master
于 2012-10-14T09:32:27.783 に答える