2015-02-07 169 views
0

最近我试图用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 

感谢您的帮助!

回答

0

前一段时间我也有这个问题,在下面的事情发生了:

git push github master 
To [email protected]:Joey-project/project.git 
! [rejected]  master -> master (non-fast-forward) 
error: failed to push some refs to '[email protected]:Joey-project/project.git' 

有人告诉我,这种情况发生的最常见的原因是因为一个试图分支推送到远程分支在此期间已更新。

一般来说一个必须使用下面的命令的变化:

git fetch github; git merge github/master 

你已经看了RomanKapitonov的问题(heroku: Gemfile.lock is required issue)任何机会呢?我相信这与你的问题有关。

0

试着在您的本地运行rake assets:precompile,因为它看起来像您的资产,即JavaScript或CSS文件中有一些错误。