views:

114

answers:

5

I'm follow an online railstutorial

Everything is ok but when trying to push the master directory to heroku. When it come to this:

Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.0

install everything but sqlite3, here it output:
Installing sqlite3 (0.1.1) /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:164:in `install': sqlite3 requires Ruby version >= 1.9.1. (Gem::InstallError)
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `run'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'
        from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/bundle:13
        from /usr/ruby1.8.7/bin/bundle:19:in `load'
        from /usr/ruby1.8.7/bin/bundle:19
       FAILED:
 !     Heroku push rejected, failed to install gems via Bundler

Now the thing is: I am using ruby 1.9.2, 1.8.7 is not even installed. when I list my local gems, bundle has this two versions: bundler (1.0.2, 1.0.1) (I don't know why) So it seems that there is something bad with the paths but I don't know how to solve it. Thanks for your help.

A: 

Ruby 1.9 isn't yet supported on heroku. Try to live with 1.8.7 (for example, downgrade a little your sqlite3 gem).

Nikita Rybak
I'm not sure about the problem that @elmany is running into, but I've bene using 1.9.2 and Rails 3.0 exclusively for the last couple of weeks with Heroku and things have worked just fine. The only time I had to reverte back to 1.8.7 was when doing a db:pull.
Joost Schuur
@Joost Strange, maybe heroku page I refer to is outdated. Can't tell, as I run rails 2 only.
Nikita Rybak
Yes, Heroku now support Ruby 1.9.2. But not at the time I tried to push. Also, for production one must forget about sqlite and use pg
elmany
+1  A: 

You want to use the sqlite3-ruby gem, not the sqlite3 gem.

Ryan Bigg
I second this answer; the error you described is exactly what happens when you try to push to Heroku with `gem 'sqlite3'` in your Gemfile. Replace it with `gem 'sqlite3-ruby', :require => 'sqlite3'`, do a `bundle install`, commit, and push again.
BinaryMuse
A: 

Do you really mean to install sqlite on Heroku? Shouldn't that gem be limited to your development environment only, not production? You can't do much with sqlite on Heroku seeing how you can't write to the filesystem, nor can you specify a custom database (Heroku fully manages your database setting on pushed apps).

tfe
Heroku is smart enough to ignore sqlite on the production environment. You can use it for local development and don't have to do anything special with your Gemfile to trigger it to be ignored or excluded in production there. They will even ignore your database.yml's production block and automatically use PostgreSQL. Their read only file system makes it impossible to use sqlite anyway.
Joost Schuur
+1  A: 

You're going off on the wrong path - Heroku doesn't run Sqlite, it runs PostgreSQL. When you deploy your app it creates a new database.yml file for you. So you shouldn't specify Sqlite in your gemfile - you should only specify it for your development environment.

Something like this:

group :production, :staging do
  gem "pg"
end

group :development, :test do
  gem "sqlite3-ruby", :require => "sqlite3"
end

If you want to read more about Heroku database stuff, go here. I asked a similar question (and got my answer) here.

Jaco Pretorius
Hi, I follow your recipe and it worked. Thanks.
elmany
A: 

The reason 1.8.7 is showing up in your log is that is the default ruby version on heroku. If you want to use 1.9.2, see the doc on switching stacks: http://docs.heroku.com/stack

tee