0

I created a small Rails app and I want to deploy it. I am getting a error when pushing to Heroku. I know this question has been asked already, but none of the solutions are working for me. I am on Ubuntu. This is what the error says :

 Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

Here is the Gemfile.

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'



# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

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

gem 'pg'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
3
  • have you tryed the command gem install sqlite3 -v '1.3.7' before bundle install
    – G SubbaRao
    Commented May 13, 2013 at 6:26
  • Yeah and I get the same error still.. Commented May 13, 2013 at 20:55
  • create a new gemset and try to use different gemset
    – G SubbaRao
    Commented May 14, 2013 at 10:13

2 Answers 2

0

I think there is a conflict between using postgresql and sqlite3 in your Rails app. You've set sqlite3 to run in development and test but also wrote postgresql to run in production, development, and test. I would suggest specifying the postgresql gem to run in production only.

group :production do
  gem 'pg'
end
2
  • I am still getting the same error. I had a problem similar to this, but with installing the pg gem, and to solve it, I had to run sudo apt-get install postgresql libpq-dev first, before running bundle install. I am not sure if this is the case with this problem as well. Commented May 12, 2013 at 13:48
  • Have you tried just installing gem install sqlite3 then running bundle install?
    – thank_you
    Commented May 12, 2013 at 17:28
0

I figured it out! I think the problem was that I was installing the production gems locally and this was causing errors with Heroku. I updated my gemfile then ran bundle update and then the major step was to run bundle install --without production.

source 'https://rubygems.org'

gem 'rails', '3.2.13'

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


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'

  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.2'

group :production do
  gem 'pg', '0.12.2'
end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.