gpt4 book ai didi

ruby-on-rails - Heroku 部署问题.. 仍然

转载 作者:行者123 更新时间:2023-12-03 18:38:11 28 4
gpt4 key购买 nike

昨天我问了一个关于插入 Heroku 的问题。它不工作,然后突然开始工作。我什么都没改变。现在在一个新的应用程序上,我遇到了完全相同的问题。我决定包含我的整个 Gemfile,希望我可以继续没有这种令人难以置信的挫败感

source 'https://rubygems.org'

gem 'rails', '3.2.11'

group :production, :staging do
gem "pg"
end

group :development, :test do
gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end

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

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


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

gem 'sqlite3'


# 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'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

更新 gem 文件后,我运行:
$bundle install
$git add Gemfile
$git add Gemfile.lock
$git git commit -m "message"
$git push heroku master

我仍然收到此错误
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app

To git@heroku.com:warm-dusk-1436.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:warm-dusk-1436.git'

最佳答案

安装 sqlite3 似乎有问题gem,在您的 Gemfile 中指定要在所有环境中安装,即使 Heroku 不会使用它。

尝试移动gem 'sqlite3'到开发组,这样您的生产环境就不会尝试安装它。

关于ruby-on-rails - Heroku 部署问题.. 仍然,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14387869/

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