git push heroku master issue - ruby

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'

Related

An error occurred while installing pg (1.0.0), and Bundler cannot continue

I'm trying to deploy Zipsell with heroku. However when I run through the heroku and ruby setup and try to deploy via:
git clone https://github.com/yongfook/zipsell
cd zipsell
./bin/setup
I get the error message:
An error occurred while installing pg (1.0.0), and Bundler cannot continue.
Make sure that gem install pg -v '1.0.0' --source 'https://rubygems.org/' succeeds before bundling.
In Gemfile:
pg
I have run through the setup process now multiple times and reinstalled all but still am not able to deploy. Any idea what is going wrong?
From the repo you posted it seems the error message is very clear. From the Gemfile of the repo you shared it seems you haven't install pg which is the postgresql (You will need to remove sqlite.
The problem is that there are some missing dependencies that you don't have installed and that why the error is thrown. There is the concepts of gems which is packaged code. https://rubygems.org/ via the following website you can find some of the gems you'r missing. There is also the versions which have to be compatible.
What you'll do is search for the missing gems shown in the error message. Check for the correct version if you the gem in your Gemfile but the version is conflicting.
https://github.com/yongfook/zipsell/blob/master/Gemfile
bundle update
install the missing gems
gem install pg
and so on. Or do it straight in the Gemfile.

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.

RubyGems issue on OS X Lion

I created a new RoR application, but whenever I run bundle install (which installs RSpec along other gems) I get the following error:
Gem::Package::FormatError: no metadata found in /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem
An error occured while installing selenium-webdriver (2.22.0), and Bundler cannot continue.
Make sure that gem install selenium-webdriver -v '2.22.0' succeeds before bundling.
When I run gem install selenium-webdriver -v '2.22.0', I get the following error message:
ERROR: Error installing selenium-webdriver:
invalid gem format for /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem
I tried manually removing the gem from cache folder and then rerun bundle install but I still get the same error messages.
Any ideas how to fix this?
Update gems
gem update --system
gem update
Check Gemfile in your rails application. Should content: gem "selenium-webdriver", "~> 2.22.0"
Run bundle install again.
I don't quite understand the above solution although it might work for someone. I ran into the same error but with different gem. I got problem with nokogiri and got this error message:
Gem::Package::FormatError: no metadata found in /home/myname/.rvm/gems/ruby-1.9.3-p194/cache/nokogiri-1.5.5.gem
I went to /home/myname/.rvm/gems/ruby-1.9.3-p194/cache/ and removed the file nokogiri-1.5.5.gem and I was able to run bundle again. I think there is something messed up with the .gem file.
Remove the cached copy of the gem and then try installing it again
rm -rf /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem
gem install selenium-webdriver -v '2.22.0'

heroku db:pull does not work?

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

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