Search code examples
ruby-on-railsdeploymentcapistrano

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

Solution

  • 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