1

i am trying to deploy diaspora on heroku but getting this error while deploying am using rails 4.1.8 with ruby 2.0.0 on ubuntu 14.04 I had tried bundle update but it doesn't worked..any solution..??

> ahmed@ahmed-desktop:~/diaspora$ git push -u heroku heroku:master
> Counting objects: 132081, done.
> Delta compression using up to 2 threads.
> Compressing objects: 100% (29619/29619), done.
> Writing objects: 100% (132081/132081), 91.87 MiB | 163.00 KiB/s, done.
> Total 132081 (delta 101146), reused 132070 (delta 101138)
> remote: Compressing source files... done.
> remote: Building source:
> remote:
> remote: -----> Deleting 6 files matching .slugignore patterns.
> remote: -----> Ruby app detected
> remote: -----> Compiling Ruby/Rails
> remote: -----> Using Ruby version: ruby-2.0.0
> remote: -----> Installing dependencies using 1.7.12
> remote:        Running: bundle install --without development:test --path
> vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
> remote:        You are trying to install in deployment mode after changing
> remote:        your Gemfile. Run `bundle install` elsewhere and add the
> remote:        updated Gemfile.lock to version control.
> remote:        You have deleted from the Gemfile:
> remote:        * mysql2 (= 0.3.16)
> remote:        Bundler Output: You are trying to install in deployment
> mode after changing
> remote:        your Gemfile. Run `bundle install` elsewhere and add the
> remote:        updated Gemfile.lock to version control.
> remote:
> remote:        You have deleted from the Gemfile:
> remote:        * mysql2 (= 0.3.16)
> remote:  !
> remote:  !     Failed to install gems via Bundler.
> remote:  !
> remote:
> remote:  !     Push rejected, failed to compile Ruby app
> remote:
> remote: Verifying deploy...
> remote:
> remote: !    Push rejected to reddodo.
> remote:
> To https://git.heroku.com/reddodo.git
>  ! [remote rejected] heroku -> master (pre-receive hook declined)
> error: failed to push some refs to 'https://git.heroku.com/reddodo.git'
Ahmed Reza
  • 33
  • 4

2 Answers2

0

I believe the problem is that heroku does not support mysql out of the box. You will need to switch over to Postgres or use an addon, for example ClearDB.

Update: On second thought it is probably this

The error message you're getting regarding Gemfile.lock may be because your Gemfile and Gemfile.lock don't agree with each other. It sounds like you've changed something in your Gemfile since you last ran bundle install (or update). When you bundle install, it updates your Gemfile.lock with any changes you've made to Gemfile.

Make sure you run bundle install locally, and check-in to source control your newly updated Gemfile.lock after that. Then try deploying.

Edit: As recognised in the comments, a conditional in the Gemfile resulted in a valid Gemfile.lock on one platform, invalid on another. Providing a :platform flag for these platform-dependent gems in the Gemfile should solve the asymmetry.

~ Edd Morgan

Community
  • 1
  • 1
Dabrorius
  • 1,039
  • 1
  • 8
  • 17
0

You skipped part of the installation instructions, namely:

We need to switch the Gemfile.lock to PostgreSQL. Edit Gemfile and change ENV['DB'] ||= 'mysql' to ENV['DB'] ||= 'postgres'. Then run:

bundle --without development test heroku production assets
git add Gemfile Gemfile.lock
git commit -m "switch Gemfile.lock to pg exclusivly"
Jonne Haß
  • 4,792
  • 18
  • 30