2

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.

Nikita Rybak
  • 67,365
  • 22
  • 157
  • 181
elmany
  • 23
  • 1
  • 3
  • I am experiencing the same problem and I haven't resolved it so far. I followed the fix here but to no avail http://www.landlessness.net/2010/09/when-deploying-to-heroku-recently.html – arscariosus Oct 15 '10 at 15:58

6 Answers6

14

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.

Community
  • 1
  • 1
Jaco Pretorius
  • 24,380
  • 11
  • 62
  • 94
1

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

Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261
  • 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. – Michelle Tilley Oct 03 '10 at 19:09
0

Make sure you install pg. At least that is what I did wrong. Here you will find some help doing that. The groupthingy also look like sound advice

Community
  • 1
  • 1
0

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
  • 67,365
  • 22
  • 157
  • 181
  • 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 Oct 03 '10 at 09:04
  • @Joost Strange, maybe heroku page I refer to is outdated. Can't tell, as I run rails 2 only. – Nikita Rybak Oct 03 '10 at 09:37
  • 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 Oct 18 '10 at 05:11
0

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
  • 32,666
  • 2
  • 27
  • 24
  • 1
    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 Oct 03 '10 at 09:06
0

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
  • 4,149
  • 1
  • 32
  • 44