Installing vagrant-librarian-chef Has net-ssh Version Conflicts - ruby

When trying to install vagrant-librarian-chef plugin for Vagrant 1.8.1 I get the following error
$ vagrant plugin install vagrant-librarian-chef
Ignoring bigdecimal-1.2.7 because its extensions are not built. Try: gem pristine bigdecimal --version 1.2.7
Ignoring bigdecimal-1.2.7 because its extensions are not built. Try: gem pristine bigdecimal --version 1.2.7
Installing the 'vagrant-librarian-chef' plugin. This can take a few minutes...
The plugin(s) can't be installed due to the version conflicts below.
This means that the plugins depend on a library version that conflicts
with other plugins or Vagrant itself, creating an impossible situation
where Vagrant wouldn't be able to load the plugins.
You can fix the issue by either removing a conflicting plugin or
by contacting a plugin author to see if they can address the conflict.
Vagrant could not find compatible versions for gem "net-ssh":
In Gemfile:
vagrant (= 1.8.1) x86-mingw32 depends on
net-ssh (~> 3.0.1) x86-mingw32
vagrant (= 1.8.1) x86-mingw32 depends on
net-scp (~> 1.1.0) x86-mingw32 depends on
net-ssh (>= 2.6.5) x86-mingw32
vagrant (= 1.8.1) x86-mingw32 depends on
net-scp (~> 1.1.0) x86-mingw32 depends on
net-ssh (>= 2.6.5) x86-mingw32
vagrant-librarian-chef (>= 0) x86-mingw32 depends on
librarian-chef (>= 0) x86-mingw32 depends on
chef (>= 0.10) x86-mingw32 depends on
net-ssh (~> 2.1.3) x86-mingw32
When I do gem list net-ssh I get the following back:
*** LOCAL GEMS ***
net-ssh (3.0.2, 2.9.4)
net-ssh-gateway (1.2.0)
net-ssh-multi (1.2.1)
Any help with what's wrong? I'm a total newbie to both ruby and vagrant which probably isn't helping the situation!

The problem is a conflict in the net-ssh version. Vagrant 1.8.1 uses v3.0.1, but vagrant-librarian-chef accepts versions up to 2.9.
Downgrading the vagrant version to 1.7.4 solved the issue for me.

Related

how to install logstash plugin (logstash-integration-jdbc)

I'm trying to install logstash-integration-jdbc following this git logstash-integration-jdbc
running logstash 7.12.1
I've installed jruby
$ jruby --version
jruby 9.1.17.0 (2.3.3) 2020-02-29 fffffff OpenJDK 64-Bit Server VM 11.0.11+9-Ubuntu-0ubuntu2.20.04 on 11.0.11+9-Ubuntu-0ubuntu2.20.04 +jit [linux-x86_64]
and bundler gem
$ ruby -S gem list --local
*** LOCAL GEMS ***
bundler (2.2.19)
bundler-unload (1.0.2)
cmath (default: 1.0.0)
csv (default: 1.0.0)
did_you_mean (1.2.0)
executable-hooks (1.6.1)
fileutils (default: 1.1.0)
gem-wrappers (1.4.0)
ipaddr (default: 1.2.0)
jar-dependencies (default: 0.4.0)
jruby-launcher (1.1.17 java)
jruby-openssl (0.10.7 java, default: 0.10.2 java)
jruby-readline (default: 1.3.7 java)
json (default: 2.2.0 java)
minitest (5.10.3)
net-telnet (0.1.1)
power_assert (1.1.3)
psych (default: 3.1.0 java)
rake (13.0.3, 12.3.2)
rake-ant (default: 1.0.4)
rdoc (default: 6.1.2)
rubygems-bundler (1.4.5)
rvm (1.11.3.9)
scanf (default: 1.0.0)
test-unit (3.2.8)
webrick (default: 1.4.2)
xmlrpc (0.3.0)
I also done clone from the git source
$ ./gradlew vendor
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.3/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
BUILD SUCCESSFUL in 4s
2 actionable tasks: 2 executed
but when I try to install the bundle
$ bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...........................................................
Bundler could not find compatible versions for gem "logstash-core":
In Gemfile:
logstash-integration-jdbc was resolved to 5.1.1, which depends on
logstash-core-plugin-api (>= 1.60, <= 2.99) was resolved to 1.60.1, which
depends on
logstash-core (>= 2.4.0.snapshot1, <= 2.4.99)
logstash-integration-jdbc was resolved to 5.1.1, which depends on
logstash-core (>= 6.5.0)
What should I do now?

Bundler could not find compatible versions for gem activesupport with specific versions

I am trying to do a bundle install but am getting the following error:
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
***private gem*** was resolved to 0.4.2, which depends on
activesupport (~> 5.0)
***private gem*** was resolved to 1.0, which depends on
activesupport (~> 4)
What does this mean?
I have searched through the internet and getting answers such as do a bundle update, or remove the Gemfile.lock, but none has been working for me.
I have also tried doing a gem install activesupport -v 4.0 and gem install activesupport -v 5.0
Thanks in advance

Managing conflicting dependencies in Gemfile.lock

In my gemspec file:
I have a gem dependency called zconfig that explicitly requires net-ssh version 2.6.8
I'm also using net-sftp, which in turn requires net-ssh version >= 2.6.5
When I bundle install, bundler is smart enough to recognize the needs of both gems and correctly identifies 2.6.8 as the version of net-ssh to install.
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
...
net-ssh (2.6.8)
...
zconfig (0.2.7)
mysql (~> 2.9.1)
mysql2 (~> 0.3.13)
net-ssh (~> 2.6.8)
net-ssh-gateway (~> 1.2.0)
sequel (~> 4.1.0)
sqlite3 (~> 1.3.7)
So far, while testing on the remote server, I've been cloning the project and installing these gems with bundle install --deployment and then running the project with the locally instaled vendor gems using bundle exec ..
However, I'm now done with development and I've packaged the project as a gem and installed it on the remote server. The problem is that when executing the gem ruby doesn't adhere to my Gemfile.lock specification and uses net-ssh 2.7.0, which causes a conflict:
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1615:in `raise_if_conflicts': Unable to activate zconfig-0.2.7, because net-ssh-2.7.0 conflicts with net-ssh (~> 2.6.8) (Gem::LoadError)
Is there a way to do something like bundle exec my_gem so that it uses the Gemfile.lock specifications?
Just define the specific version of the gem to a required version by adding the following line in the gemfile:
gem 'net-ssh', '2.6.8'
or in the thinegem.gemspec:
spec.add_dependency 'net-ssh', '2.6.8'
And if you did add the gemfile.lock into the project, it shell be used during a deployment anyway.

bundle command not found after upgrading to Ruby 2.0.0 on OSX

I can't run bundle. I just upgraded Ruby to 2.0.0 using rvm. I'm using rvm 1.23.4 on OSX Mountain Lion.
Any idea what to do?
echo $PATH
/Users/Mohamad/.rvm/gems/ruby-2.0.0-p247/bin:/Users/Mohamad/.rvm/gems/ruby-2.0.0-p247#global/bin:/Users/Mohamad/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/Mohamad/.rvm/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/git/bin
Update I ran gem list and bundler does not appear to be installed.
capistrano (2.15.5)
highline (1.6.19)
i18n (0.6.5)
net-scp (1.1.2)
net-sftp (2.1.2)
net-ssh (2.7.0)
net-ssh-gateway (1.2.0)
rake (10.1.0)
sshkit (1.0.0)
term-ansicolor (1.2.2)
tins (0.12.0)
RVM should install this gem for you - if it was not done this is a bug - open a ticket here: https://github.com/wayneeseguin/rvm/issues

Why does bundler think it needs a specific version when the gemspec specifies a pessimistic constraint?

My gemspec clearly requires active_support ~> 3.0, but bundler is failing to bundle install saying that my gem requires active_support = 3.0. WTF bundler? Can anyone explain this?
$ gem install code_filter
Successfully installed activesupport-3.0.0
Successfully installed active_support-3.0.0
Successfully installed code_filter-0.1.1
$ gem dependency code_filter
Gem code_filter-0.1.1
active_support (~> 3.0, runtime)
$ bundle
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://192.168.10.22/...
Fetching gem metadata from http://rubygems.org/...........
Fetching gem metadata from http://192.168.10.22/..
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
code_filter (= 0.1.1) ruby depends on
activesupport (= 3.0.0) ruby
json_builder (~> 3.1) ruby depends on
activesupport (3.0.20)

Resources