Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Backup complains about missing dependency even though it is installed #420

Closed
fullofcaffeine opened this Issue Mar 13, 2013 · 13 comments

Comments

Projects
None yet
7 participants

Hi,

I'm using RVM to create an env just for the Backup gem. After upgrading the gem, I started getting the following error when trying to perform my backup:

> backup perform --trigger my_backup   
[2013/03/13 01:17:00][error] CLIError: Dependency::LoadError: Dependency Missing
[2013/03/13 01:17:00][error]   Gem Name: net-ssh
[2013/03/13 01:17:00][error]   Used for: SSH Protocol (SSH Storage)
[2013/03/13 01:17:00][error]   
[2013/03/13 01:17:00][error]   To install the gem, issue the following command:
[2013/03/13 01:17:00][error]   > backup dependencies --install net-ssh
[2013/03/13 01:17:00][error]   Please try again after installing the missing dependency.

I then installed net-ssh:

gem install net-ssh
Successfully installed net-ssh-2.6.6
1 gem installed

I tried again, and got the same error.

If I try the suggested solution of running dependecies --install net-ssh, I get this:

 backup dependencies --install net-ssh
=== Bundler Detected ===
This command should not be run within a Bundler managed environment.
While it is possible to install Backup and it's dependencies using
Bundler, the gem version requirements must still be met as shown by:
> backup dependencies --list

But I'm not using bundler. Here's the folder structure:

tree
.
├── config
│   ├── cron_log.log
│   └── schedule.rb
├── config.rb
├── data
│   └── my_backup
│       └── S3.yml
├── log
│   └── backup.log
└── other
    ├── Backup.sh
    ├── README
    └── home_exclude.txt

Any ideas?

Thanks,

Marcelo.

@ghost

ghost commented Mar 13, 2013

@fullofcaffeine Thanks for reporting this. You can now update to v3.1.3 and use the backup dependencies --install command to solve this.

I have a similar situation, but in a Bundler managed environment.
The latest capistrano version depends on net-ssh 2.6.6, whereas this gem explicitly stays below 2.5.x as its dependency. Whats the reason for that?

jshou commented Mar 18, 2013

A couple of the other gems (net-scp, excon, fog) are also locking at lower gem versions.

+1 same error (backup version 3.2.0)... can't solve it.

This issue is getting more and more annoying. Having to use older versions of several gems because of this hard dependency.

@ghost

ghost commented Apr 18, 2013

@tanelsuurhans You are forcing Backup and your application to use the same versions of dependencies by having Backup in your application's Gemfile. Take it out and you'll have no problems. Backup is an application, not a library. Your app does not depend on it.

This specific issue with backup dependencies --install was fixed was fixed in 3.1.3.

@ghost ghost closed this Apr 18, 2013

Contributor

manuelmeurer commented Jun 7, 2013

@burns I am still confused about how to use backup with a Rails application that uses Bundler. I followed your advice and didn't add Backup to the Gemfile but only installed it on the host machine.

Now, if I try to execute Backup, I get the following error:

[2013/06/07 13:32:53][error] CLIError
[2013/06/07 13:32:53][error] --- Wrapped Exception ---
[2013/06/07 13:32:53][error] Gem::LoadError: You have already activated multi_json 1.7.3, but your Gemfile requires multi_json 1.7.6. Using bundle exec may solve this.

How do I solve this (if not manually adjusting all gems that Backup uses in my Gemfile to require the older versions)?

@ghost

ghost commented Jun 7, 2013

Are you trying to activate your Rails app's bundle from within Backup's config.rb or a model file?
That's the only way I can duplicate that error.

Contributor

manuelmeurer commented Jun 14, 2013

Damn, you're right, I was loading the Rails environment in the backup config file. Sorry...

axsuul commented Sep 20, 2013

I've been using 3.0.27 without any problems. Installed 3.4.0 today on a new project and had net-ssh dependency error. Reverted back to 3.0.27 and everything was fine.

Note: I put backup in my Gemfile because it's convenient and easier to deploy.

mbixby commented Oct 9, 2013

+1 to axsuul and others. Backup is an app dependency (just like e.g. Unicorn) and it's often convenient to put them and related config in the app itself.

@ghost

ghost commented Oct 9, 2013

Your app does not require Backup's code to be loaded in order to function, therefore it is not a dependency.
Understand that Backup could be distributed as a rpm/deb package (like Vagrant), but we choose to distribute it using RubyGems because it's simpler.

axsuul commented Nov 6, 2013

@burns It makes it easier to deploy

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment