gpt4 book ai didi

ruby-on-rails - 无法在heroku上启动rails应用程序

转载 作者:行者123 更新时间:2023-12-04 23:10:19 27 4
gpt4 key购买 nike

我正在尝试将 rails 应用程序部署到 heroku,但不断收到以下错误。我原以为管理 postgres gem 是 heroku 会处理的事情。

我已经尝试了所有我能想到的在本地机器上安装 postgres 的方法,如果我想安装 postgres gem,我需要这样做。也没有叫 activerecord-postgresql-adapter 的 gem ...我猜这是 rails 附带的标准适配器??

关于如何解决这个问题的任何想法?

App failed to start

/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (no such file to load -- pg) (RuntimeError)
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:438:in `initialize_database'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:141:in `process'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
from /disk1/home/slugs/135415_c7f31f0_9f1f/mnt/config/environment.rb:9
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
... 14 levels...
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
from /home/heroku_rack/heroku.ru:1:in `new'
from /home/heroku_rack/heroku.ru:1

最佳答案

Upgrade your Gemfile to Bundler 0.9并添加 pg gem 。就这么简单。

关于ruby-on-rails - 无法在heroku上启动rails应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2302509/

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