heroku db:pull does not work? - ruby

I get the following error message:
heroku db:pull --debug postgres://USERNAME:PASSWORD#localhost/test
Loaded Taps v0.3.23
Warning: Data in the database 'postgres://USERNAME:PASSWORD#localhost/test' will be overwritten and will not be recoverable.
Receiving schema
Unable to fetch tables information from http://heroku:foo9dsfsdfsdb465ar#taps19.heroku.com. Please check the server log.
The command above does not produce any messages in the log that can be viewed using 'heroku logs'.
Any idea what I am doing wrong?

Use pgbackups instead of taps/db:pull
http://devcenter.heroku.com/articles/pgbackups

I answered to similar problem here:
Unable to fetch tables information when running heroku db:pull
I found some kind of work-around.
I have the same problem with my SHARED_DATABASE on heroku
ruby 1.9.2
gems:
pg (0.11.0)
heroku (2.32.4)
heroku-api (0.3.5)
taps (0.3.24)
heroku db:pull ended with:
Unable to fetch tables information from http://...#taps19.heroku.com. Please check the server log.
I switched to ruby 1.8.7 using rvm and heroku db:pull works fine.
Back again to ruby 1.9.2 to develop my application.
I hope this help someone until db:pull will be fixed with ruby 1.9.2.

Was able to get it going by reverting back to ruby 1.9.3 and Rails 3.1.0.
Here are some instructions on how to do that with rvm:
$ rvm install 1.9.3
$ ruby -v
$ rvm use 1.9.3-p286
$ rvm gemset create rails310
$ rvm 1.9.3-p286#rails310
$ rails -v
$ gem install rails -v 3.1.0
$ rvm gemset list
$ heroku db:pull –app <yourapp>
$ gem install taps
$ gem install sqlite3
$ heroku db:pull –app <yourapp>
More reading on rvm can be found here: http://rvm.io/gemsets/basics

Related

Rails 5 'full_gem_path' : uninitialized constant Bundler

Edit: I found the answer here right after I finished my post.
Orirginal Post:
I just upgraded from Mac Yosemite (10.10.5) to El Sierra (10.12)
I can create a rails project fine via
rails new <name>
However, when I go into the newly created project folder, running any rails commands
e.g. rails -v or rails s
Results in this stack trace:
BUT, when I exit from the project folder, I can continue to run rails commands without issue such as
e.g. rails -v and rails new <name>
Below are my versions if it helps any:
Please help!
Check if your bundler version is v1.13 (with bundler -v). If it is indeed v1.13, then you can remove v1.13 and install v1.12 to fix this problem:
sudo gem uninstall bundler -v1.13.1 OR gem uninstall bundler
THEN sudo gem install -n /usr/local/bin bundler -v 1.12
if you use rvm you can remove bundler follow this way
rm -rf ~/.rvm/gems/ruby-2.0.0-p647/gems/bundler-1.13.1
Taken from:
http://kuro-sean-blog.logdown.com/posts/901359-cant-not-new-a-rails-app-with-rails-new-command
Just in case someone comes to this question the way I did, I was getting this issue when trying to install rspec. I was able to install it using bundle's exec command:
bundle exec rails generate rspec:install
Not sure if this would also solve the OP's question.

Upgraded Heroku from gem to toolbelt, but still old version

Heroku recommends switching from the old gem to the new "Heroku Toolbelt":
https://blog.heroku.com/archives/2012/10/15/upgrading-to-the-heroku-toolbelt
I ran these commands successfully:
$ sudo gem uninstall heroku
$ sudo gem uninstall heroku --all
$ wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
Then I restarted my terminal, and... I still have the old version:
$ heroku version
heroku-gem/2.33.5 (x86_64-linux) ruby/1.9.3
$ heroku fork
! `fork` is not a heroku command.
$ which heroku
/home/me/.rvm/gems/ruby-1.9.3-p362/bin/heroku
What did I forget?
Similar questions:
How do I replace the Heroku gem with Heroku Toolbelt? but none of the answers work
Heroku toolbelt fails update and rails/heroku migrating from gem to toolbelt but I have no ~/.heroku/client folder
It looks like you still have the gem installed in one of your rvm installations.
Try removing the gem without sudo:
gem uninstall heroku
The value of which heroku should not be in the ~/.rvm folder, but /usr/local.

git push heroku master issue

I am having a problem with my application not being uploaded to heroku. When I typed in:
git push heroku master
I get an error at the end:
**Results logged to /tmp/build_2akv91a7tpdfl/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
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.
!
! Push rejected, failed to compile Ruby/Rails app**
When i tried installing the gems its asking for, and redid the process the same error message comes up even after i installed 'gem install sqlite3 -v '1.3.7.''
(For those who are following Michael Hartl rails tutorials i followed it by detail but I'm still getting an error message.)
Any help will be greatly appreciated. I am new to rails so if you have a solution, please do speak in layman's terms.
I don't think you can use sqlite3 on Heroku. You can use postgres instead.
Remove sqlite3 gem and add pg gem in your Gemfile.
gem 'pg'
Since Heroku provides you a PostgreSQL database for your app, edit your Gemfile and change this line:
gem 'sqlite3'
To this:
gem 'pg'

Error installing Heroku Toolbelt

Tried to install Heroku Toolbelt but now I get a Gem:LoadError error when trying to issue any heroku command.
$ heroku -v
/Users/xyz/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in
`to_specs': Could not find heroku (>= 0) amongst [...]
(Gem::LoadError)
$ which heroku
/Users/xyz/.rvm/gems/ruby-1.9.3-p194#global/bin/heroku
It seems it's still seeking the gem, but I already uninstalled it. How can I fix this?
(OSX Mountain Lion)
I might be misunderstanding the issue, but if it is just that the heroku gem is not installed/missing try:
$ gem install heroku
I had the same issues initially with ROR on Windows/OS X.(Everyone suggested me to move to LINUX/UNIX)
Rather than installing the Heroku Toolbet (which breaks ruby and rails which is already installed) install the heroku gem along with foreman gem.
gem install heroku
gem install foreman
Then you can use it easily.

Error running heroku console. can't update heroku

When I try to run heroku console I get the following error:
user#omnipresent:~/rails/demo$ heroku console
! This version of the heroku gem has been deprecated.
! Please update it by running: gem update heroku
When I do the update..it says there is nothing to update!
user#omnipresent:~/rails/demo$ gem update heroku
Updating installed gems
Nothing to update
Following are my versions:
user#omnipresent:~/rails/demo$ heroku version
heroku-gem/1.5.2
user#omnipresent:~/rails/demo$ ruby -v
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
user#omnipresent:~/rails/demo$ rails -v
Rails 2.3.5
running heroku list shows following:
user#omnipresent:/usr/bin$ gem list heroku
*** LOCAL GEMS ***
heroku (1.8.5, 1.8.3, 1.8.0, 1.5.2)
Even though I already had 1.8.5...I guess installing it again forces the class cache update.
user#omnipresent:~/rails/seconddemo$ sudo gem install heroku
Successfully installed heroku-1.8.5
1 gem installed
Installing ri documentation for heroku-1.8.5...
Updating class cache with 3098 classes...
Installing RDoc documentation for heroku-1.8.5...
user#omnipresent:~/rails/seconddemo$ heroku console
Ruby console for myapp.heroku.com
>>

Resources