Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Heroku-安装sqlite3(1.3.7)时出错_Ruby On Rails_Ruby On Rails 3_Heroku_Heroku Toolbelt_Heroku Postgres - Fatal编程技术网

Ruby on rails Heroku-安装sqlite3(1.3.7)时出错

Ruby on rails Heroku-安装sqlite3(1.3.7)时出错,ruby-on-rails,ruby-on-rails-3,heroku,heroku-toolbelt,heroku-postgres,Ruby On Rails,Ruby On Rails 3,Heroku,Heroku Toolbelt,Heroku Postgres,在尝试将类项目部署到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 w

在尝试将类项目部署到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
在做了一些调查之后,我发现
sqlite3
没有在Heroku上运行,我需要设置
postresql
,并在我的GEM文件中指定开发/部署,如下所示:

gem 'rails', '3.2.13'

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

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

然而,我仍然得到同样的错误。我是为了一个学校项目而做这件事的,所以这是我在Heroku的第一次尝试,我对RubyonRails也很陌生。如有任何帮助/想法,将不胜感激。谢谢

您是否将正确的分支推到Heroku?确保您在主分支上,并且您的更改已提交

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

看来你走对了方向。您是否在本地运行bundle并将Gemfile和Gemfile.lock提交到git存储库?此外,您还可以用sqlite3替换sqlite3 ruby(这样就不需要require了)


提示:修复此问题后,您可能会在资产管道预编译内容中遇到下一个错误。。为了解决这个问题,只需将gem'rails\u 12factor',group::production添加到您的gem文件中。
bundle install
git add Gemfile
git add Gemfile.lock
git commit -m "Update database gem environments."
git push heroku master