Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

You are trying to install in deployment mode after changing your Gemfile

I'm trying to deploy my Rails app to my DigitalOcean server with

cap production deploy

But I'm getting an error,

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* rails-assets-angular-devise

You have changed in the Gemfile:
* rails-assets-angular-devise from `no specified source` to `rubygems repository
https://rubygems.org/, https://rails-assets.org/`
bundle stderr: Nothing written

SSHKit::Command::Failed: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* rails-assets-angular-devise

You have changed in the Gemfile:
* rails-assets-angular-devise from `no specified source` to `rubygems repository
https://rubygems.org/, https://rails-assets.org/`
bundle stderr: Nothing written

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as [email protected]: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* rails-assets-angular-devise

You have changed in the Gemfile:
* rails-assets-angular-devise from `no specified source` to `rubygems repository
https://rubygems.org/, https://rails-assets.org/`
bundle stderr: Nothing written
alucardu@alucardu-VirtualBox:~/sites/movieseat(Deploy) $ source "https://rails-assets.org" do
bash: https://rails-assets.org: No such file or directory
alucardu@alucardu-VirtualBox:~/sites/movieseat(Deploy) $   gem "rails-assets-angular-devise"
ERROR:  While executing gem ... (Gem::CommandLineError)
    Unknown command rails-assets-angular-devise
alucardu@alucardu-VirtualBox:~/sites/movieseat(Deploy) $ end

There is something wrong with my Gemfile and the Gemfile.lock and it has to do with rails-assets-angular-devise but I can't figure out how to fix it.

I've tried running bundle install on my server but still the same error. I've tried removing the Gemlock.file and doing bundle install on my local and then commiting it and pushing it to my deploy branch but still the same error.

This is the rails-assets-angular-devise part in the gemfile.

source "https://rails-assets.org" do
  gem "rails-assets-angular-devise"
end
like image 544
Peter Boomsma Avatar asked Sep 03 '15 16:09

Peter Boomsma


2 Answers

Check bundler version on server in correctly gemset - probably you have old bundler version in your gemset or local gem (if you doesn't use rvm on server)

I have the same problem, steps to resolved it:

  • login to server
  • switch rvm to correctly for your application
  • $ gem update bundler
  • close ssh session and try again cap [env] deploy
like image 189
Fist Avatar answered Sep 22 '22 20:09

Fist


This problem occurs due to different bundler gem versions on your deployment server and your development server. bundler gem version must be equal on the server and your development environment

once the same bundler version is installed on both the production and development environment then deploy again using:

cap production deploy

check bundler version using gem info bundler and install or uninstall version as per requirement

Install:

gem install bundler -v <bundler_version>
E.g.
gem install bundler -v 2.2.4

Uninstall:

gem uninstall bundler -v <bundler_version>
E.g.
gem uninstall bundler -v 2.2.4
like image 39
Gaurav Patil Avatar answered Sep 19 '22 20:09

Gaurav Patil