Deploy a simple test app with Sinatra + DataMapper + Postgres + Heroku returns: Installing do_sqlite3 (0.10.7) error - postgresql

Goal: Deploy a simple test app with Sinatra + DataMapper + Postgres + Heroku
Issue: When using gem 'dm-postgres-adapter' gem 'dm-sqlite-adapter' to push the app to Heroku I get this.
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!
I have visited that github link and someone had the same issue but gets directed to Heroku, https://github.com/carlhuda/bundler/issues/1488 . I have sent an email to the mailing list of Heroku and am waiting for a reply.
I ran into LoadError: no such file to load -- dm-sqlite-adapter
So I added that into the Gemfile and Gemfile.lock and this is as far as I can ever get
I have tried to instal and setup Postgres locally but thats brand new set of pains that i'm slowly learning but can not get to work yet.
I have also read each and every question here with a simular issue, some progressed me to this point and some dont have responses from the asker and leave it a mystery.
Gemfile
-----------------
source :rubygems
gem '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, DateTime
end
DataMapper.auto_upgrade!
get '/' do
#notes = Note.all :order => :id.desc
#title = 'All Notes'
erb :home
end
Notes
-------------------------
10.7 Lion
Xcode 4 is installed
sqlite3 installed by Homebrew
~ which sqlite3
/usr/bin/sqlite3
~ gem list sql
sqlite3 (1.3.5)
sqlite3-ruby (1.3.3)
~ gem list do_sqlite3
do_sqlite3 (0.10.7)
~ brew info sqlite3
sqlite 3.7.9
http//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
Error Log
------------------------------
~ rubyfish2 git:(master) git push heroku master
Counting 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.7
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching 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.rb
checking for sqlite3.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. 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}/lib
Gem 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.out
from /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

The error when installing do_sqlite (Installing do_sqlite3 (0.10.7) with native extensions...) is simply because this gem requires the sqlite3 libraries to be installed, and they are not on Heroku. To fix it, remove dm-sqlite-adapter (which is what idepends on do_sqlite) from your Gemfile. If you want to keep Sqlite for development and use Postgres for production, you can use Gembundler's groups:
gem 'dm-postgres-adapter', :group => :production
gem 'dm-sqlite-adapter', :group => :development
This way, the postgresql adapter will be installed in production on Heroku, but sqlite will be used locally for development.
The line in your code that sets up Datamapper is:
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/recall.db")
This looks for a environment variable DATABASE_URL and if it's present uses it otherwise uses the sqlite url. Getting the LoadError: no such file to load -- dm-sqlite-adapter error suggests that this variable isn't actually set. Run heroku config, there should be entries for DATABASE_URL and SHARED_DATABASE_URL. If they are not set you need to add the database.
Have a look at this other SO question which deals with a similar issue. The solution there was to run heroku addons:add shared-database:5mb.

Related

Sinatra/Rack/Bundler application unable to install postgres gem

I'm trying to install the postgres gem "pg" in my rack/bundler app and keep failing when attempting to install through RubyMine.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using addressable (2.3.5)
Using bcrypt-ruby (3.1.2)
Using data_objects (0.10.13)
Using dm-core (1.2.1)
Using dm-aggregates (1.2.0)
Using dm-constraints (1.2.0)
Using dm-migrations (1.2.0)
Using fastercsv (1.5.5)
Using json (1.8.1)
Using json_pure (1.8.0)
Using multi_json (1.8.2)
Using dm-serializer (1.2.2)
Using dm-timestamps (1.2.0)
Using dm-transactions (1.2.0)
Using stringex (1.5.1)
Using uuidtools (2.1.4)
Using dm-types (1.2.2)
Using dm-validations (1.2.0)
Using datamapper (1.2.0)
Using dm-do-adapter (1.2.0)
Installing do_postgres (0.10.13)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/adam419/.rvm/rubies/ruby-2.0.0-p195/bin/ruby extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-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=/Users/adam419/.rvm/rubies/ruby-2.0.0-p195/bin/ruby
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
Gem files will remain installed in /Users/adam419/.rvm/gems/ruby-2.0.0-p195#global/gems/do_postgres-0.10.13 for inspection.
Results logged to /Users/adam419/.rvm/gems/ruby-2.0.0-p195#global/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out
An error occurred while installing do_postgres (0.10.13), and Bundler cannot
continue.
Make sure that `gem install do_postgres -v '0.10.13'` succeeds before bundling.
So for some reason, with my current project, if I install a gem through the command line it doesn't get added to the External Libraries folder in Rubymine, and have so far been relying on it's own bundle/gem installer. So from reading other questions, I saw to download the Postgres93 support for Mac os x and in the command line I attempted to install postgres gem by specifying the path to the pg_config file, and it downloaded successfully, but didn't get added to the libraries in the project in Rubymine.
sudo gem install pg -- --with-pg config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config
The above command worked, but didn't cause the gem to appear in Rubymine, and thus I am still unable to push to Heroku. So when attempting to give the additional arguments to the bundle installer I get syntax errors when entering in
--with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config
Any ideas how to resolve this?
Solution -- Reinstalled Postgresql with homebrew

Trouble upgrading to rails 2.3.15 with rack 1.1.3

I'm getting the following error when trying to fire up script/console for my rails 2.3.15 app, after upgrading from rails 2.3.5. Does this mean the issue is with bundler 1.2.1 is not compatible with rack 1.1.3? Any help would be appreciated immensely.
usr/lib/ruby/gems/1.8/gems/bundler-1.2.1/lib/bundler/rubygems_integration.rb:157:in gem': can't activate rack (~> 1.0.1), already activated rack-1.1.3. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
from /home/developer/bigpink/vendor/rails/actionpack/lib/action_controller.rb:34
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require'
from /home/developer/bigpink/vendor/rails/railties/lib/commands/server.rb:2
from script/server:3:inrequire'
from script/server:3
In my case, problem solved by the following steps:
Deleted the directory $PROJECT_ROOT/vendor/rails
Modified RAILS_GEM_VERSION in config/environment.rb
we used this process to upgrade Rails to 3.2.11 on our Heroku apps (as reported here)
stop – your Ruby on Rails (RoR) server
edit – appropriate line in gem file to read [one of]:
gem ‘rails’, ’3.2.11′
gem ‘rails’, ’3.1.10′
gem ‘rails’, ’3.0.19′
gem ‘rails’, ’2.3.15′
run – gem update
run – bundle update
run - bundle install
test – rspec # or test-driven dev’t framework of choice
launch – rails s
test – # interact with Rails server & explore if all is well
run – git add .
run – git commit -a -m “upgrade Rails server to ver. [x.y.z]“
run - git push # to github or rcs of choice
run - git push heroku # or to deployment server of choice

Why is bundler not able to install rake even though rake appears to be present?

I'm having some trouble with rbenv and bundler. When I bundle install on my app, I get an error saying that an error occurred while installing Rake.
I'm thinking this has something to do with rbenv not pointing to the write path for gems -- but I'm not positive.
Why is bundler not able to install rake when rake appears to be present?
Console Output
deploy#telemed-test:/u/apps/telemed_solutions/current$ bundle install
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
NoMethodError: private method `open' called for Gem::Package:Class
An error occured while installing rake (0.9.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2'` succeeds before bundling.
deploy#telemed-test:/u/apps/telemed_solutions/current$
deploy#telemed-test:/u/apps/telemed_solutions/current$ rbenv version
1.9.3-p125 (set by /home/deploy/.rbenv/version)
deploy#telemed-test:/u/apps/telemed_solutions/current$ gem list
*** LOCAL GEMS ***
bigdecimal (1.1.0)
bundler (1.1.3)
io-console (0.3)
json (1.6.6, 1.5.4)
minitest (2.12.1, 2.5.1)
rake (0.9.2)
rdoc (3.12, 3.9.4)
It might be time to upgrade rubygems. Some of the specification files may be calling rubygems methods that don't exist in your version.
Run gem --version to check your current version.
And gem update --system to upgrade to the latest.

Jruby gem error win32-service for rsense

I am trying to install Rsense, I am following the directions from here Rsense Docs
RSENSE_HOME is set but i cannot install the jruby win32-service to complete the steps to have the rsense service started at boot.
This is the full error, I also ran as error suggested specifying jruby version. Any ideas on completing the install?
C:\Users\RenshawFamily>echo %RSENSE_HOME%
C:\Rsense
C:\Users\RenshawFamily>jruby -S gem install win32-service
Fetching: win32-api-1.4.8.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing win32-service:
ERROR: Failed to build gem native extension.
c:/jruby-1.6.3/bin/jruby.exe extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very wel
l.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
checking for strncpy_s()... IOError: Cannot run program "cc" (in directory "C:\j
ruby-1.6.3\lib\ruby\gems\1.8\gems\win32-api-1.4.8\ext"): CreateProcess error=2,
The system cannot find the file specified
popen at org/jruby/RubyIO.java:3540
xpopen at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:323
open at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:260
xpopen at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:316
egrep_cpp at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:538
have_func at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:758
checking_for at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:652
postpone at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:286
open at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:260
postpone at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:286
open at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:260
postpone at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:282
checking_for at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:651
have_func at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:755
(root) at extconf.rb:9
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. 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=c:/jruby-1.6.3/bin/jruby
Gem files will remain installed in c:/jruby-1.6.3/lib/ruby/gems/1.8/gems/win32-a
pi-1.4.8 for inspection.
Results logged to c:/jruby-1.6.3/lib/ruby/gems/1.8/gems/win32-api-1.4.8/ext/gem_
make.out
C:\Users\RenshawFamily>jruby -S gem install win32-service --ruby=c:/jruby-1.6.3/
bin/jruby
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --ruby=c:/jruby-1.6.3/bin/jruby
win32-service uses C extensions. Gems that use C extensions are generally not compatible with JRuby, although there are efforts being made to address that - see here for background
Are you able to use MRI/CRuby for your project?
Or you could use a java based service management lib, but then that might not work with emacs/rsense.
Or you could roll up your sleeves and make win32-service JRuby compatible!
I had the same problem when installing the win-32-service gem. This solved it:
gem install win32-service --platform=mswin32
So your command should probably be
jruby -S gem install win32-service --platform=mswin32
although I'm guessing here.

Heroku not Loading do_postgres dependency

Getting started on Heroku, but it does not seem to be loading the necessary dependency (do_postgres (~> 0.10.2)) for dm-postgres-adapter.
The Gemfile is as such:
source :gemcutter
gem 'dm-postgres-adapter', '1.0.2'
gem 'dm-sqlite-adapter', '1.0.2'
gem 'sinatra', '1.1.0'
gem 'mustache', '0.9'
gem 'datamapper', '1.0.2'
gem 'json', '1.5.1'
With the relevant section of the Gemfile.lock looking as follows:
dm-postgres-adapter (1.0.2)
dm-do-adapter (~> 1.0.2)
do_postgres (~> 0.10.2)
When pushed to Heroku, it does not seem to install do_postgres:
-----> Heroku receiving push
-----> Sinatra app detected
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test
Fetching source index for http://rubygems.org/
Installing addressable (2.2.4)
Installing data_objects (0.10.3)
Installing extlib (0.9.15)
Installing dm-core (1.0.2)
Installing dm-aggregates (1.0.2)
Installing dm-migrations (1.0.2)
Installing dm-constraints (1.0.2)
Installing fastercsv (1.5.4)
Installing json_pure (1.5.1)
Installing dm-serializer (1.0.2)
Installing dm-timestamps (1.0.2)
Installing dm-transactions (1.0.2)
Installing stringex (1.1.0)
Installing uuidtools (2.1.2)
Installing dm-types (1.0.2)
Installing dm-validations (1.0.2)
Installing datamapper (1.0.2)
Installing dm-do-adapter (1.0.2)
Installing dm-postgres-adapter (1.0.2)
Installing dm-sqlite-adapter (1.0.2)
Installing mustache (0.9.0)
Installing rack (1.2.1)
Installing tilt (1.2.2)
Installing sinatra (1.1.0)
Using bundler (1.0.7)
Your bundle is complete! It was installed into ./.bundle/gems/
Compiled slug size is 1.7MB
-----> Launching... done
And, indeed, Heroku does not find the gem and does not launch:
2011-03-07T10:48:31-08:00 heroku[slugc]: Slug compilation finished
2011-03-07T10:48:35-08:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem do_postgres (~> 0.10.2) (Gem::LoadError)
2011-03-07T10:48:35-08:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
2011-03-07T10:48:35-08:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:249:in `activate'
2011-03-07T10:48:35-08:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate'
2011-03-07T10:48:35-08:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `each'
2011-03-07T10:48:35-08:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35:in `require'
2011-03-07T10:48:35-08:00 app[web.1]: from /app/04eca654-0ab6-43de-aae1-1dbed7bef1a1/home/.bundle/gems/ruby/1.8/gems/dm-core-1.0.2/lib/dm-core/adapters.rb:163:in `load_adapter'
2011-03-07T10:48:35-08:00 app[web.1]: from /app/04eca654-0ab6-43de-aae1-1dbed7bef1a1/home/.bundle/gems/ruby/1.8/gems/dm-core-1.0.2/lib/dm-core/adapters.rb:133:in `adapter_class'
2011-03-07T10:48:35-08:00 app[web.1]: from /app/04eca654-0ab6-43de-aae1-1dbed7bef1a1/home/.bundle/gems/ruby/1.8/gems/dm-core-1.0.2/lib/dm-core/adapters.rb:13:in `new'
2011-03-07T10:48:35-08:00 app[web.1]: from /app/04eca654-0ab6-43de-aae1-1dbed7bef1a1/home/.bundle/gems/ruby/1.8/gems/dm-core-1.0.2/lib/dm-core.rb:266:in `setup'
2011-03-07T10:48:35-08:00 app[web.1]: from ./lib/database.rb:21:in `initialize'
database.rb line 21 is this:
DataMapper.setup(:default, ENV['DATABASE_URL'] || 'sqlite3://' + Dir.pwd + '/database.db')
Which is code straight from the Heroku site: http://devcenter.heroku.com/articles/database#common_issues_migrating_to_postgresql , under "Using the DATABASE_URL Environment variable". The app runs on Sqlite locally, but Heroku uses postgresql. I was hoping DataMapper would make the transition a cinch!
I have tried explicitly including
gem 'do_postgres', '~>0.10.2'
in the Gemfile, to no avail. This should not be necessary, anyway. Submitted a ticket to Heroku support as well, but haven't heard back from them...
Heroku got back to me, very promptly:
Hello,
I noticed you're using windows for
your development environment. There is
currently a limitation on with bundler
and cross platform use, i.e. if you
develop locally on windows but deploy
to a unix server like heroku. The
current workaround is to remove your
Gemfile.lock.
Best,
[removed]
Indeed, after removing Gemfile.lock Heroku installed the do_postgres gem properly. I had originally committed Gemfile.lock because the Heroku interface recommended it, ("Gemfile.lock will soon be required"), so perhaps a little warning somewhere that this breaks compatibility with Windows would be nice. Of course, the cross-platform thing was not my decision. :)