gpt4 book ai didi

ruby-on-rails - Heroku 推送拒绝来源中的 : can't find jquery-rails-2. 0.0

转载 作者:行者123 更新时间:2023-12-02 05:48:12 25 4
gpt4 key购买 nike

我正在尝试将 Enki gem 博客推送到 Heroku,但遇到错误

Could not find jquery-rails-2.0.0 in any of the sources

但是,在 Gemfile 中我有

`gem 'jquery-rails'`

我以前用这个设置推送 Enki 博客从来没有遇到过问题。这是完整的错误消息

 Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Could not find jquery-rails-2.0.0 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app

收到错误消息后,我将其添加到 gemfile

gem 'jquery-rails-2.0.0'

我收到此错误消息

Could not find gem 'jquery-rails-2.0.0 (>= 0) java' in the gems available on this machine.

然后我尝试这样做

gem install jquery-rails

它给了我

  Successfully installed jquery-rails-2.0.2
1 gem installed
Installing ri documentation for jquery-rails-2.0.2...
Installing RDoc documentation for jquery-rails-2.0.2...

但是推送不起作用,同样的错误

   -----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.rc
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Could not find jquery-rails-2.0.0 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app

这是gem文件

source 'https://rubygems.org'

gem 'rails', '3.2.6'
gem 'heroku'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

gem 'uglifier', '>= 1.0.3'
end

group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end

group :production do
gem 'thin'
end
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
gem 'trinidad'
gem 'jruby-openssl'
end

gem 'jquery-rails'
#gem 'jquery-rails-2.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

# Bundle the extra gems:
gem 'RedCloth', '~> 4.2.9', :require => 'redcloth'
gem 'ruby-openid', :require => 'openid'
gem 'rack-openid', :require => 'rack/openid'
gem 'aaronh-chronic', :require => 'chronic' # Fixes for 1.9.2
gem 'coderay'
gem 'lesstile'
gem 'formtastic'
gem 'will_paginate', '~> 3.0.2'
gem 'exception_notification', '~> 2.5.2'
gem 'open_id_authentication'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :test do
gem 'database_cleaner'
gem 'cucumber-rails', :require => false
gem 'cucumber-websteps', :require => false
gem 'factory_girl'
gem 'rspec'
gem 'nokogiri', '~> 1.5.0'
gem 'webrat'
end

group :development, :test do
gem 'rspec-rails'
end

最佳答案

我遇到了同样的错误并使用以下方法修复了它:


捆绑更新 jquery-rails

经过调查,jquery-rails 2.0.0 似乎已从 ruby​​gems 中删除:http://d.pr/i/cLms/1ReBI4U8无论出于何种原因。因此,当该 gem 是最新版本时,您(和我)很可能碰巧安装了 jquery-rails。

还需要注意的是,删除 Gemfile.lock 可能很危险,在大多数情况下不建议这样做。这会导致下载 Gemfile 中没有版本号的每个 gem 的所有最新版本。如果 gems 已使用破坏 API 的更改进行更新(发生的频率比您想象的要高),您的应用程序可能会崩溃。但也可能不会。请小心,如果有测试用例,请运行它们。这让我头疼不已。

您可以在此处阅读有关捆绑程序、Gemfile 和 Gemfile.lock 如何工作的更多信息(以及如何正确升级某些 gem 的指南):http://viget.com/extend/bundler-best-practices

关于ruby-on-rails - Heroku 推送拒绝来源中的 : can't find jquery-rails-2. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11876788/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com