最近我試圖用Heroku將我的Rails項目推向git,但出現了一些棘手的問題。
所有的線我粘貼在這裏:http://pastebin.com/5y09wFCi
我在這裏貼線,這是我認爲最重要的是:
Ruby on Rails Heroku - 錯誤部署項目
$ git push heroku master
Initializing repository, done.
Counting objects: 98, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (89/89), done.
Writing objects: 100% (98/98), 20.04 KiB | 0 bytes/s, done.
Total 98 (delta 8), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.7.12
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/...........
.
.
.
Bundle completed (26.03s)
Cleaning up the bundler cache.
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
I, [2015-02-07T17:06:17.823271 #1283] INFO -- : Writing /tmp/build_374afebb598e92eacd894ae2e50e6a4d/public/assets/application-4be62d87c5bb7f3e09992032049b2bd0.js
rake aborted!
wrong number of arguments (2 for 1)
.
.
.
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
To [email protected]:stark-tor-4197.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:stark-tor-4197.git'
鮮明-TOR-4197是我隨機命名的項目。
它可能也很重要 - 我讀到,Heroku不能用於sqlite3,所以我必須在我的gemfile中進行更改。 現在關於數據庫的部分看起來像這樣:
http://pastebin.com/EKjFzKDh
# Use postgresql as the database for Active Record
gem 'pg'
gem 'rails_12factor', group: :production
感謝您的幫助!