Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 铁路更新_Ruby On Rails_Heroku_Bundler - Fatal编程技术网

Ruby on rails 铁路更新

Ruby on rails 铁路更新,ruby-on-rails,heroku,bundler,Ruby On Rails,Heroku,Bundler,我试图运行git-push-heroku,并显示以下错误 In Gemfile: rails (= 3.2.3) depends on railties (= 3.2.3) jquery-rails (= 2.0.0) depends on railties (3.2.5) 这是我的档案: source 'https://rubygems.org' gem 'rails', '3.2.3' gem 'jquery-rails', '2.0.0' gem 'bootstrap-

我试图运行
git-push-heroku
,并显示以下错误

In Gemfile:

rails (= 3.2.3) depends on

  railties (= 3.2.3)

jquery-rails (= 2.0.0) depends on

  railties (3.2.5)
这是我的档案:

source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'jquery-rails', '2.0.0'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.5'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.9.0'
  gem 'guard-rspec', '0.5.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

group :test do
  gem 'capybara', '1.1.2'
  gem 'factory_girl_rails', '1.4.0'
  gem 'cucumber-rails', '1.2.1', require: false
  gem 'database_cleaner', '0.7.0'
  gem 'rb-fsevent', '0.4.3.1', :require => false
  gem 'growl', '1.0.3'
  gem 'guard-spork', '0.3.2'  
  gem 'spork', '0.9.0'
  gem 'launchy', '2.1.0'
end

group :production do
  gem 'pg', '0.12.2'
end

我将rails版本更改为3.2.5,并进行了捆绑包更新和安装。仍然存在同样的问题,因此我将rails版本改回了3.2.3

检查Gemfile.lock并搜索哪个gem需要railties 3.2.5


还要尝试删除Gemfile.lock并再次运行“bundle install”

几天前,我遇到了一个与此相关的问题。
我所做的是

  • 已删除Gemfile.lock
  • 已从Gemfile中删除gem的版本
  • Bundle安装

  • 除非有必要,否则我通常不在Gemfile中使用版本。

    我执行了以下步骤,我从另一个堆栈溢出问题中发现,只需在本地提示符下进行bundle安装。现在放置Gemfile.lock git add。git commit-m“commit message here”git push现在做git push heroku它应该可以工作了。这对我来说很有用:)如果你用Git add将链接粘贴到这个答案,那就太好了。不是一个好方法。添加时请始终尝试指定文件名。删除Gemfile.lock将导致各种gem更新,通常更新到具有中断API更改的版本,这些更改将导致应用程序意外崩溃。@nilbus这是错误的。如果指定gem版本,删除Gemfile.lock不会破坏任何东西。另外,如果你有一个不错的测试覆盖率,这不是一个问题。你是对的。如果您为所有内容指定gem版本(正如此人所做的),那么删除Gemfile.lock应该是安全的。我只是担心,因为大多数项目都没有指定gem版本(这通常是个坏主意)。大多数项目也没有完全覆盖与gems的交互,这是另一回事。我通常指定gem版本(或者至少,我知道我在做什么,而不是在做什么)并编写测试。从项目生命周期的中长期来看,任何其他方法通常都是错误的。在Gemfile中指定它们会使bundle更新在您需要时变得困难和有问题,特别是当您指定了要更新的另一个gem的依赖项的特定版本时。它被称为“可复制构建”。指定gem版本可以确保任何人都可以复制相同的环境,即使出于任何原因删除了Gemfile.lock。我这么做已经好几年没有遇到问题了。