简体   繁体   English

Heroku-安装sqlite3(1.3.7)时发生错误

[英]Heroku - An error occurred while installing sqlite3 (1.3.7)

While trying to deploy a class project to heroku, I received the following error: 尝试将类项目部署到heroku时,出现以下错误:

  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.

  Detected sqlite3 gem which is not supported on Heroku.
  https://devcenter.heroku.com/articles/sqlite3


  Push rejected, failed to compile Ruby/Rails app

After doing some investigation I found that sqlite3 does not run on Heroku, and I need to set up postresql instead, and specify development/deployment in my Gemfile like so: 经过一番调查后,我发现sqlite3不能在Heroku上运行,而我需要设置postresql ,并在Gemfile中指定开发/部署,如下所示:

gem 'rails', '3.2.13'

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

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

However, I am still getting the same error. 但是,我仍然遇到相同的错误。 I am doing this for a school project, so I this is my first try at Heroku and I'm pretty new to Ruby on Rails as well. 我正在做一个学校项目,所以这是我在Heroku上的第一次尝试,而且我对Ruby on Rails也很陌生。 Any help/ideas would be greatly appreciated. 任何帮助/想法将不胜感激。 Thanks! 谢谢!

Are you pushing the correct branch to Heroku? 您是否在将正确的分支推送到Heroku? Make sure that you're on the master branch, and that your changes have been committed. 确保您位于master分支上,并且您的更改已提交。

$ git checkout master
$ git add .
$ git commit -m "Commit message."  
$ git push heroku master

It looks like you are on the right track. 看来您在正确的轨道上。 Have you run bundle locally and committed Gemfile and Gemfile.lock to your git repository? 您是否在本地运行包并将Gemfile和Gemfile.lock提交到git存储库? Also, you can replace sqlite3-ruby with just sqlite3 (and then no require is necessary). 另外,您可以仅用sqlite3替换sqlite3-ruby(然后不需要)。

bundle install
git add Gemfile
git add Gemfile.lock
git commit -m "Update database gem environments."
git push heroku master

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安装sqlite3(1.3.7)时出现Heroku错误 - Heroku error with installing installing sqlite3 (1.3.7) 安装 sqlite3 (1.3.7) 时出错,Bundler 无法继续无法创建 rails 应用程序 - An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue Cannot create rails app git push heroku master:安装sqlite3时出错 - git push heroku master: Error occurred while installing sqlite3 安装sqlite3(1.3.11)时出错,Bundler无法继续 - An error occurred while installing sqlite3 (1.3.11), and Bundler cannot continue 安装sqlite3(1.3.13)时发生错误,并且Bundler无法继续 - An error occurred while installing sqlite3 (1.3.13), and Bundler cannot continue “安装sqlite3(1.3.13)时发生错误,并且Bundler无法继续” - “An error occurred while installing sqlite3 (1.3.13), and Bundler cannot continue” 尝试“ gem安装sqlite3 -v'1.3.7'时出错” - Error while trying to “gem install sqlite3 -v '1.3.7'” Windows 10上的Rails错误(安装sqlite3(1.4.1)时发生错误,并且Bundler无法继续) - Rails error on windows 10 (An error occurred while installing sqlite3 (1.4.1), and Bundler cannot continue) Rails - 错误“安装 sqlite3 (1.3.13) 时出错,Bundler 无法继续” - Rails - error " An error occurred while installing sqlite3 (1.3.13), and Bundler cannot continue" RoR Michael Hartl Tutorial (3rd) - 安装 sqlite3 时出错,Bundler 无法继续 - RoR Michael Hartl Tutorial (3rd) - An error occurred while installing sqlite3, and Bundler cannot continue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM