gpt4 book ai didi

ruby-on-rails - 将 master 推送到 heroku 时出现问题

转载 作者:行者123 更新时间:2023-12-01 12:41:51 25 4
gpt4 key购买 nike

我正在关注在线 railstutorial

一切正常,但在尝试将主目录推送到 heroku 时。说到这里:

Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.0

install everything but sqlite3, here it output:
Installing sqlite3 (0.1.1) /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:164:in `install': sqlite3 requires Ruby version >= 1.9.1. (Gem::InstallError)
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/bundle:13
from /usr/ruby1.8.7/bin/bundle:19:in `load'
from /usr/ruby1.8.7/bin/bundle:19
FAILED:
! Heroku push rejected, failed to install gems via Bundler

现在的事情是:我正在使用 ruby​​ 1.9.2,甚至没有安装 1.8.7。当我列出本地 gems 时,bundle 有这两个版本:bundler (1.0.2, 1.0.1) (不知道为什么)所以路径似乎有问题,但我不知道如何解决。感谢您的帮助。

最佳答案

您走错了路 - Heroku 不运行 Sqlite,它运行 PostgreSQL。当您部署应用程序时,它会为您创建一个新的 database.yml 文件。所以你不应该在你的 gemfile 中指定 Sqlite - 你应该只为你的开发环境指定它。

像这样:

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

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

如果您想阅读更多有关 Heroku 数据库的内容,请转至 here .我问了一个类似的问题(并得到了答案)here .

关于ruby-on-rails - 将 master 推送到 heroku 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3848393/

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