捆绑安装工作。但是当我git推送heroku master时,我得到了这个:
C:\Sites\first_app>git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.132' t
list of known hosts.
Counting objects: 65, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (51/51), done.
Writing objects: 100% (65/65), 26.10 KiB, done.
Total 65 (delta 3), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.1.2
Running: bundle install --without development:test --path vendor/bun
-binstubs bin/
Fetching gem metadata from https://rubygems.org/.........
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 3.2.1) ruby depends on
railties (= 3.2.1) ruby
jquery-rails (= 2.0.0) ruby depends on
railties (3.2.3)
Failed to install gems via Bundler.
Heroku push rejected, failed to compile Ruby/rails app
To git@heroku.com:evening-frost-9408.git
[remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:evening-frost-9408.git'
这是我的Gem文件:
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.0'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
我基本上遵循Ruby on Rails教程。但我的轨道是3.2.1,但在线书籍说轨道3.2.3。我尝试将其更改为3.2.3和〜> 3.2.3,我仍然得到相同的错误消息
由于
答案 0 :(得分:3)
我遇到了同样的问题,尝试在heroku上部署时无法运行'bundle install'和同样的问题(我正在遵循相同的教程)。
找到一个好的答案here:rubygems.org不提供HTTPS,因此将gemfile的标题从https://rubygems.org
更改为http://rubygems.org
。
答案 1 :(得分:0)
我有类似的问题,并认为我会添加我的解决方案。
最初我的主要项目被分成了包含在主项目中的宝石。随着gem和项目之间的耦合的增加,将gems的代码直接带入主rails项目的/ lib是有意义的。在合并期间,.gitignore文件合并没有任何冲突。不幸的是,gem的.gitignore与独立项目非常不同。随着我的进展,当我在本地更新一个gem时,它会在远程推送部署到Heroku时失败。事实证明,gem中的.gitignore包含Gemfile.lock
和*.gem
之类的内容。
TLDR;确保你的.gitignore文件是理智的