postgresql – 使用Sinatra DataMapper部署一个简单的测试应用程序Postgres Heroku返回:安装do_sqlite3(0.10.7)错误

postgresql – 使用Sinatra DataMapper部署一个简单的测试应用程序Postgres Heroku返回:安装do_sqlite3(0.10.7)错误,第1张

概述目标:使用Sinatra DataMapper Postgres Heroku部署一个简单的测试应用程序 问题:当使用gem’dm-postgres-adapter’gem’dm-sqlite-adapter’将应用程序推送到Heroku时,我得到了这个. 使用本机扩展安装do_sqlite3(0.10.7)不幸的是,发生了致命错误.请在https://github.com/carlhuda/bu 目标:使用Sinatra DataMapper Postgres Heroku部署一个简单的测试应用程序

问题:当使用gem’dm-postgres-adapter’gem’dm-sqlite-adapter’将应用程序推送到Heroku时,我得到了这个.
使用本机扩展安装do_sqlite3(0.10.7)不幸的是,发生了致命错误.请在https://github.com/carlhuda/bundler/issues将此错误报告给Bundler问题跟踪器,以便我们进行修复.谢谢!

我访问了那个github链接,有人遇到了同样的问题,但是被定向到Heroku,https://github.com/carlhuda/bundler/issues/1488.我已经发送电子邮件到Heroku的邮件列表,我正在等待回复.

我遇到了LoadError:没有这样的文件要加载–dm-sqlite-adapter
所以我把它添加到了Gemfile和Gemfile.lock中,这是我所能得到的

我试图在本地安装和设置Postgres,但那是我正在慢慢学习但却无法开始工作的新的痛苦.

我也在这里用一个类似的问题阅读了每一个问题,有些人把我推到了这一点,有些人没有得到提问者的回答而留下一个谜.

的Gemfile

-----------------source :rubygemsgem 'sinatra','1.1.0'gem 'thin','1.2.7'gem 'data_mapper'gem 'dm-postgres-adapter'gem 'dm-sqlite-adapter'

Gemfile.lock的

------------------------...dm-sqlite-adapter (1.2.0)  dm-do-adapter (~> 1.2.0)  do_sqlite3 (~> 0.10.6)...

procfile

--------------------web: bundle exec ruby recall.rb -p $PORT

Recall.rb

---------------------require 'rubygems'  require 'sinatra'require 'data_mapper'DataMapper.setup(:default,ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/recall.db")class Note    include DataMapper::Resource    property :ID,Serial    property :content,Text,:required => true    property :complete,Boolean,:required => true,:default => 0    property :created_at,DateTime    property :updated_at,DateTimeendDataMapper.auto_upgrade!get '/' do    @notes = Note.all :order => :ID.desc    @Title = 'All Notes'    erb :homeend

笔记

-------------------------10.7 lionXcode 4 is installedsqlite3 installed by Homebrew~ which sqlite3/usr/bin/sqlite3~ gem List sqlsqlite3 (1.3.5)sqlite3-ruby (1.3.3)~ gem List do_sqlite3do_sqlite3 (0.10.7)~ brew info sqlite3sqlite 3.7.9http//sqlite.org/Depends on: readline/usr/local/Cellar/sqlite/3.7.9 (9 files,1.9M)http//github.com/mxcl/homebrew/commits/master/library/Formula/sqlite.rb

错误日志

------------------------------~ rubyfish2 git:(master) git push heroku masterCounting objects: 22,done.Delta compression using up to 4 threads.Compressing objects: 100% (14/14),done.Writing objects: 100% (15/15),2.42 KiB,done.Total 15 (delta 8),reused 0 (delta 0)-----> Heroku receiving push-----> Removing .DS_Store files-----> Ruby app detected-----> Installing dependencIEs using Bundler version 1.1.rc.7Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deploymentFetching gem Metadata from http//rubygems.org/.........Using addressable (2.2.6)Using bcrypt-ruby (3.0.1)Using daemons (1.1.5)Using dm-core (1.2.0)Using dm-aggregates (1.2.0)Using dm-constraints (1.2.0)Using dm-migrations (1.2.0)Using fastercsv (1.5.4)Using Json (1.6.4)Using Json_pure (1.6.4)Using multi_Json (1.0.4)Using dm-serializer (1.2.1)Using dm-timestamps (1.2.0)Using dm-transactions (1.2.0)Using stringex (1.3.0)Using uuIDtools (2.1.2)Using dm-types (1.2.1)Using dm-valIDations (1.2.0)Using data_mapper (1.2.0)Using data_objects (0.10.7)Using dm-do-adapter (1.2.0)Using do_postgres (0.10.7)Using dm-postgres-adapter (1.2.0)Installing do_sqlite3 (0.10.7) with native extensions Unfortunately,a Fatal error has occurred. Please report this error to the Bundler issue tracker at https//github.com/carlhuda/bundler/issues so that we can fix it. Thanks!/usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)/usr/local/bin/ruby extconf.rbchecking for sqlite3.h... no*** extconf.rb Failed ***Could not create Makefile due to some reason,probably lack ofnecessary librarIEs and/or headers.  Check the mkmf.log file for moredetails.  You may need configuration options.ProvIDed configuration options:--with-opt-dir--without-opt-dir--with-opt-include--without-opt-include=${opt-dir}/include--with-opt-lib--without-opt-lib=${opt-dir}/lib--with-make-prog--without-make-prog--srcdir=.--curdir--ruby=/usr/local/bin/ruby--with-sqlite3-dir--without-sqlite3-dir--with-sqlite3-include--without-sqlite3-include=${sqlite3-dir}/include--with-sqlite3-lib--without-sqlite3-lib=${sqlite3-dir}/libGem files will remain installed in /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/do_sqlite3-0.10.7 for inspection.Results logged to /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/do_sqlite3-0.10.7/ext/do_sqlite3/gem_make.outfrom /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/source.rb:90:in `block in install'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/rubygems_integration.rb:82:in `preserve_paths'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/source.rb:89:in `install'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:73:in `block in install_gem_from_spec'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/rubygems_integration.rb:97:in `with_build_args'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:72:in `install_gem_from_spec'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:56:in `block in run'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:55:in `run'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:12:in `install'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/cli.rb:220:in `install'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/task.rb:22:in `run'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor.rb:263:in `dispatch'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/base.rb:386:in `start'from /tmp/build_1ikvsvr378qb6/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/bin/bundle:13:in `<top (required)>'from vendor/bundle/ruby/1.9.1/bin/bundle:19:in `load'from vendor/bundle/ruby/1.9.1/bin/bundle:19:in `<main>' ! !     Failed to install gems via Bundler. ! !     Heroku push rejected,Failed to compile Ruby app
安装do_sqlite时出错(使用本机扩展安装do_sqlite3(0.10.7)…)只是因为这个gem需要安装sqlite3库,而且它们不在Heroku上.要修复它,请从Gemfile中删除dm-sqlite-adapter(这是do_sqlite上的IDepends).如果你想保留sqlite进行开发并使用Postgres进行生产,你可以使用 Gembundler’s groups:
gem 'dm-postgres-adapter',:group => :productiongem 'dm-sqlite-adapter',:group => :development

这样,postgresql适配器将在Heroku上安装生产,但sqlite将在本地用于开发.

代码中设置Datamapper的行是:

DataMapper.setup(:default,ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/recall.db")

这将查找环境变量DATABASE_URL,如果它存在则使用它,否则使用sqlite url.获取LoadError:没有要加载的此类文件 – dm-sqlite-adapter错误表明此变量实际上未设置.运行heroku配置,应该有DATABASE_URL和SHARED_DATABASE_URL的条目.如果未设置,则需要添加数据库.

看一下处理类似问题的this other SO question.解决方案是运行heroku插件:添加共享数据库:5mb.

总结

以上是内存溢出为你收集整理的postgresql – 使用Sinatra DataMapper部署一个简单的测试应用程序Postgres Heroku返回:安装do_sqlite3(0.10.7)错误全部内容,希望文章能够帮你解决postgresql – 使用Sinatra DataMapper部署一个简单的测试应用程序Postgres Heroku返回:安装do_sqlite3(0.10.7)错误所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1164745.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存