【问题标题】:Ruby on Rails Heroku - error deploying projectRuby on Rails Heroku - 部署项目时出错
【发布时间】:2015-04-07 18:34:37
【问题描述】:

最近我尝试使用 Heroku 将我的 Rails 项目推送到 git,但出现了问题。
我在这里粘贴的所有行:http://pastebin.com/5y09wFCi
我在这里粘贴了我认为最重要的线条:

$ 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 git@heroku.com:stark-tor-4197.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:stark-tor-4197.git'

stark-tor-4197 是我随机命名的项目。

这可能也很重要 - 我读到,Heroku 不能与 sqlite3 一起使用,所以我必须在我的 gemfile 中进行更改。 现在关于数据库的部分如下所示:
http://pastebin.com/EKjFzKDh

# Use postgresql as the database for Active Record
gem 'pg'
gem 'rails_12factor', group: :production

感谢您的帮助!

【问题讨论】:

    标签: ruby-on-rails database git heroku


    【解决方案1】:

    不久前我也遇到了这个问题,发生了以下情况:

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

    有人告诉我,发生这种情况的最常见原因是因为有人试图将分支推送到同时已更新的远程分支。

    一般来说,必须使用以下命令的变体:

    git fetch github; git merge github/master
    

    您是否已经看过 RomanKapitonov 的问题 (heroku: Gemfile.lock is required issue)?我认为这与您的问题有关。

    【讨论】:

      【解决方案2】:

      尝试在您的本地运行 rake assets:precompile,因为您的资产(即 javascript 或 css 文件)中似乎存在一些错误。

      【讨论】:

        猜你喜欢
        • 2013-05-25
        • 1970-01-01
        • 1970-01-01
        • 2023-03-31
        • 2012-05-23
        • 2019-04-01
        • 1970-01-01
        • 2021-05-13
        • 2012-07-26
        相关资源
        最近更新 更多