简体   繁体   中英

why Heroku does not download database updates with 'Heroku db: pull'?

I have run 'heroku db:push' to download heroku db updates, it show me error:

taps load error: no such file to load --sqlite3
you may need to install or update the taps gem to use db commands.
on most systems this will be:
sudo gem install taps

I have installed heroku 2.25.0, taps 0.3.24 and I changed the Gemfile replacing gem sqlite3 with:

group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end

I think it's a problem of compatibility database between sqlite e postgresql.

is it possible? Or what can be ?

First, make sure you've got your gems all up to date by running bundle install . It won't hurt if everything's fine so you may as well make sure.

After that, you should be able to use db:pull to pull a copy to your local machine using the snippet that follows:

bundle exec heroku db:pull sqlite://local.db --app my_app

If this doesn't work for some reason, you can just change your Gemfile while pulling the database down -- and then you can change it back if you want to.

group :development, :test do
  gem 'sqlite3'
  # add this next line and run 'bundle install' until you get db:pull to work
  gem 'pg'
end
group :production do
  gem 'pg'
end

(I believe this will work, though I personally haven't tried it. Please respond if there's an issue.)

Finally, there are some issues pulling and pushing databases if you're running ruby 1.9.3 on your local machine -- but it's only if you're doing a db:push . If you have problems with that here's a link to the solution.

When you run the heroku command, it runs locally on your development machine. So the development group of your Gemfile is used:

group :development, :test do
  gem 'sqlite3'
end

Since it contains sqlite3 , you need the sqlite3 gem to be installed on your development machine. Have you run bundle install to install this gem locally? And you may need to run the heroku command within a bundle exec call to make sure the gems are loaded:

bundle exec heroku db:pull .

Finally, if you want to download Heroku DB, you should use db:pull , not db:push .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM