繁体   English   中英

Rails 4:Heroku推送被拒绝/ Gemfile问题/ GIT问题

[英]Rails 4: Heroku push rejected / Gemfile Issues / GIT Issues

我真的很困惑,非常感谢您的帮助和解释。

1.]我的gemfile当前显示如下:

source 'https://rubygems.org'

gem 'rails', '4.1.10'
gem 'bcrypt', '3.1.7'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
# gem 'foundation-rails', '5.4.5'
gem 'foundation-rails', '5.3.1.0'
gem 'simple_form'
gem "font-awesome-rails"
gem 'devise'
gem "ransack", github: "activerecord-hackery/ransack", branch: "rails-4.1"
gem "polyamorous", :github => "activerecord-hackery/polyamorous"
gem 'carrierwave'
gem 'rmagick'
gem 'acts_as_commentable'
gem "cocoon"
gem 'geocoder'
gem 'social-share-button'
gem 'twilio-ruby'
gem 'cancancan', '~> 1.10'
gem 'public_activity'
gem 'foundation-datetimepicker-rails'
gem 'jquery-ui-rails'
gem 'stripe'
gem "stripe_event"
gem 'cloudinary'

group :development, :test do
  gem 'sqlite3',     '1.3.9'
  gem 'byebug',      '3.4.0'
  gem 'web-console', '2.0.0.beta3'
  gem 'spring',      '1.1.3'
  gem 'quiet_assets'
  gem 'mailcatcher'
  gem "better_errors"
  gem 'awesome_print'
  gem 'pry'
  gem 'binding_of_caller'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace',     '0.1.3'
  gem 'guard-minitest',     '2.3.1'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor'
  gem 'unicorn',        '4.8.3'
end

2.]我的gemlock文件当前显示如下:

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.10)
      actionpack (= 4.1.10)
      actionview (= 4.1.10)
      mail (~> 2.5, >= 2.5.4)
    actionpack (4.1.10)
      actionview (= 4.1.10)
      activesupport (= 4.1.10)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.10)
      activesupport (= 4.1.10)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.1.10)
      activesupport (= 4.1.10)
      builder (~> 3.1)
    activerecord (4.1.10)
      activemodel (= 4.1.10)
      activesupport (= 4.1.10)
      arel (~> 5.0.0)
    activesupport (4.1.10)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    acts_as_commentable (4.0.2)
    ansi (1.5.0)
    arel (5.0.1.20140414130214)
    awesome_print (1.6.1)
    aws_cf_signer (0.1.3)
    bcrypt (3.1.7)
    better_errors (2.1.1)
      coderay (>= 1.0.0)
      erubis (>= 2.6.6)
      rack (>= 0.9.0)
    binding_of_caller (0.7.3.pre1)
      debug_inspector (>= 0.0.1)
    builder (3.2.2)
    byebug (3.4.0)
      columnize (~> 0.8)
      debugger-linecache (~> 1.2)
      slop (~> 3.6)
    cancancan (1.13.1)
    carrierwave (0.10.0)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
      json (>= 1.7)
      mime-types (>= 1.16)
    cloudinary (1.2.0)
      aws_cf_signer
      rest-client
    cocoon (1.2.6)
    coderay (1.1.0)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.9.1.1)
    columnize (0.9.0)
    daemons (1.2.3)
    debug_inspector (0.0.2)
    debugger-linecache (1.2.0)
    devise (3.5.2)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 3.2.6, < 5)
      responders
      thread_safe (~> 0.1)
      warden (~> 1.2.3)
    domain_name (0.5.20160615)
      unf (>= 0.0.5, < 1.0.0)
    erubis (2.7.0)
    eventmachine (1.0.5)
    execjs (2.6.0)
    ffi (1.9.10)
    font-awesome-rails (4.4.0.0)
      railties (>= 3.2, < 5.0)
    formatador (0.2.5)
    foundation-datetimepicker-rails (0.2.1)
    foundation-rails (5.3.1.0)
      railties (>= 3.1.0)
      sass (>= 3.2.0)
    geocoder (1.2.11)
    guard (2.13.0)
      formatador (>= 0.2.4)
      listen (>= 2.7, <= 4.0)
      lumberjack (~> 1.0)
      nenv (~> 0.1)
      notiffany (~> 0.0)
      pry (>= 0.9.12)
      shellany (~> 0.0)
      thor (>= 0.18.1)
    guard-minitest (2.3.1)
      guard (~> 2.0)
      minitest (>= 3.0)
    hike (1.2.3)
    http-cookie (1.0.2)
      domain_name (~> 0.5)
    i18n (0.7.0)
    jbuilder (2.3.1)
      activesupport (>= 3.0.0, < 5)
      multi_json (~> 1.2)
    jquery-rails (3.1.4)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jquery-turbolinks (2.1.0)
      railties (>= 3.1.0)
      turbolinks
    jquery-ui-rails (5.0.2)
      railties (>= 3.2.16)
    json (1.8.3)
    jwt (1.5.1)
    kgio (2.10.0)
    listen (3.0.3)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
    lumberjack (1.0.9)
    mail (2.6.3)
      mime-types (>= 1.16, < 3)
    mailcatcher (0.6.1)
      activesupport (>= 4.0.0, < 5)
      eventmachine (~> 1.0.0, <= 1.0.5)
      mail (~> 2.3)
      sinatra (~> 1.2)
      skinny (~> 0.2.3)
      sqlite3 (~> 1.3)
      thin (~> 1.5.0)
    method_source (0.8.2)
    mime-types (2.99.2)
    mini_backtrace (0.1.3)
      minitest (> 1.2.0)
      rails (>= 2.3.3)
    minitest (5.8.0)
    minitest-reporters (1.0.5)
      ansi
      builder
      minitest (>= 5.0)
      ruby-progressbar
    multi_json (1.11.2)
    nenv (0.2.0)
    netrc (0.11.0)
    notiffany (0.0.8)
      nenv (~> 0.1)
      shellany (~> 0.0)
    orm_adapter (0.5.0)
    pg (0.17.1)
    pry (0.10.1)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    public_activity (1.4.2)
      actionpack (>= 3.0.0)
      activerecord (>= 3.0)
      i18n (>= 0.5.0)
      railties (>= 3.0.0)
    quiet_assets (1.1.0)
      railties (>= 3.1, < 5.0)
    rack (1.5.5)
    rack-protection (1.5.3)
      rack
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.1.10)
      actionmailer (= 4.1.10)
      actionpack (= 4.1.10)
      actionview (= 4.1.10)
      activemodel (= 4.1.10)
      activerecord (= 4.1.10)
      activesupport (= 4.1.10)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.1.10)
      sprockets-rails (~> 2.0)
    rails_12factor (0.0.3)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.4)
    rails_stdout_logging (0.0.4)
    railties (4.1.10)
      actionpack (= 4.1.10)
      activesupport (= 4.1.10)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    raindrops (0.15.0)
    rake (11.1.2)
    rb-fsevent (0.9.6)
    rb-inotify (0.9.5)
      ffi (>= 0.5.0)
    rdoc (4.2.0)
      json (~> 1.4)
    responders (1.1.2)
      railties (>= 3.2, < 4.2)
    rest-client (1.8.0)
      http-cookie (>= 1.0.2, < 2.0)
      mime-types (>= 1.16, < 3.0)
      netrc (~> 0.7)
    rmagick (2.15.4)
    ruby-progressbar (1.7.5)
    sass (3.2.19)
    sass-rails (4.0.5)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.2)
      sprockets (~> 2.8, < 3.0)
      sprockets-rails (~> 2.0)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    shellany (0.0.1)
    simple_form (3.1.1)
      actionpack (~> 4.0)
      activemodel (~> 4.0)
    sinatra (1.4.6)
      rack (~> 1.4)
      rack-protection (~> 1.4)
      tilt (>= 1.3, < 3)
    skinny (0.2.3)
      eventmachine (~> 1.0.0)
      thin (~> 1.5.0)
    slop (3.6.0)
    social-share-button (0.1.8)
      coffee-rails
      sass-rails
    spring (1.1.3)
    sprockets (2.12.4)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.3.3)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (>= 2.8, < 4.0)
    sqlite3 (1.3.9)
    stripe (1.46.0)
      rest-client (~> 1.4)
    stripe_event (1.5.0)
      activesupport (>= 3.1)
      stripe (~> 1.6)
    thin (1.5.1)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (1.4.1)
    turbolinks (2.5.3)
      coffee-rails
    twilio-ruby (4.5.0)
      builder (>= 2.1.2)
      jwt (~> 1.0)
      multi_json (>= 1.3.0)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.7.2)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    unf (0.1.4)
      unf_ext
    unf_ext (0.0.7.2)
    unicorn (4.8.3)
      kgio (~> 2.6)
      rack
      raindrops (~> 0.7)
    warden (1.2.3)
      rack (>= 1.0)
    web-console (2.0.0.beta3)
      activemodel (~> 4.0)
      binding_of_caller (= 0.7.3.pre1)
      railties (~> 4.0)
      sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
  ruby

DEPENDENCIES
  acts_as_commentable
  awesome_print
  bcrypt (= 3.1.7)
  better_errors
  binding_of_caller
  byebug (= 3.4.0)
  cancancan (~> 1.10)
  carrierwave
  cloudinary
  cocoon
  coffee-rails (~> 4.0.0)
  devise
  font-awesome-rails
  foundation-datetimepicker-rails
  foundation-rails (= 5.3.1.0)
  geocoder
  guard-minitest (= 2.3.1)
  jbuilder (~> 2.0)
  jquery-rails
  jquery-turbolinks
  jquery-ui-rails
  mailcatcher
  mini_backtrace (= 0.1.3)
  minitest-reporters (= 1.0.5)
  pg (= 0.17.1)
  polyamorous!
  pry
  public_activity
  quiet_assets
  rails (= 4.1.10)
  rails_12factor
  ransack!
  rmagick
  sass-rails (~> 4.0.3)
  sdoc (~> 0.4.0)
  simple_form
  social-share-button
  spring (= 1.1.3)
  sqlite3 (= 1.3.9)
  stripe
  stripe_event
  turbolinks
  twilio-ruby
  uglifier (>= 1.3.0)
  unicorn (= 4.8.3)
  web-console (= 2.0.0.beta3)

3.]每当我运行bundle install都会将一些其他信息添加到名为GIT的gemfile中-我相信这是导致heroku不接受我的应用程序部署的原因

GIT
  remote: git://github.com/activerecord-hackery/polyamorous.git
  revision: 8f722a1edfaf20dbb14b21e422c629249a6fbfa6
  specs:
    polyamorous (1.3.1)
      activerecord (>= 3.0)

GIT
  remote: git://github.com/activerecord-hackery/ransack.git
  revision: 742425ade4bb66db573dc13bf436a8f3c87b733b
  branch: rails-4.1
  specs:
    ransack (1.2.4)
      actionpack (>= 4.0)
      activerecord (>= 4.0)
      activesupport (>= 4.0)
      i18n
      polyamorous (~> 1.1)

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.10)
      actionpack (= 4.1.10)
      actionview (= 4.1.10)
      mail (~> 2.5, >= 2.5.4)
    actionpack (4.1.10)
      actionview (= 4.1.10)
      activesupport (= 4.1.10)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.10)
      activesupport (= 4.1.10)
etc............

4.]当我执行git push heroku master时,出现以下错误消息:

Counting objects: 3218, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3089/3089), done.
Writing objects: 100% (3218/3218), 175.45 MiB | 602.00 KiB/s, done.
Total 3218 (delta 787), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
remote: -----> Installing dependencies using bundler 1.11.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        You are trying to install in deployment mode after changing
remote:        your Gemfile. Run `bundle install` elsewhere and add the
remote:        updated Gemfile.lock to version control.
remote:        You have added to the Gemfile:
remote:        * source: git://github.com/activerecord-hackery/polyamorous.git (at master)
remote:        * source: git://github.com/activerecord-hackery/ransack.git (at rails-4.1)
remote:        Bundler Output: You are trying to install in deployment mode after changing
remote:        your Gemfile. Run `bundle install` elsewhere and add the
remote:        updated Gemfile.lock to version control.
remote:        
remote:        You have added to the Gemfile:
remote:        * source: git://github.com/activerecord-hackery/polyamorous.git (at master)
remote:        * source: git://github.com/activerecord-hackery/ransack.git (at rails-4.1)
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to my-app-name.
remote: 
To https://git.heroku.com/my-app-name.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/my-app-name.git'

可以请我确切地告诉我如何解决此问题,因为我一无所知。 如果这是一个基本问题,我深表歉意,但是您的帮助将不胜感激-您还能建议我如何Gemfile.lock或更新Gemfile.lock

您的gemfile不是最新的。 确保捆绑安装,然后将其提交到github,以便对源代码进行所有更改,现在您可以推送到heroku了。

  1. 在您本地计算机的cd上的app目录中,然后运行bundle install
  2. 现在将您的更改提交给github git push origin master
  3. 现在将其推送到heroku git push heroku master

我遇到了同样的问题,这就是我解决这个问题的方法。 1.运行bundle install 2.提交Gemfile.lock并在将其对我有用的推送到heroku后推送到git。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM