Can't run Capistrano - dependency error - capistrano

I've installed Capistrano on my Ubuntu with the following commands
sudo gem install capistrano
sudo gem install railsless-deploy # I want to deploy a PHP website
sudo gem install capistrano-ext
When I run "capify ." in my deployment folder, have got an error:
Same error with other Capistrano command like a simple "cap -h" ...
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find capistrano (>= 0) amongst [POpen4-0.1.4, Platform-0.4.0, addressable-2.3.4, addressable-2.3.2, bundler-1.3.5, bundler-1.2.3, bundler-1.0.21, chunky_png-1.2.8, chunky_png-1.2.7, coderay-1.0.9, coderay-1.0.8, commonjs-0.2.6, compass-0.12.2, compass-normalize-1.4.3, compass-normalize-1.4.2, compass-recipes-0.3.0, em-websocket-0.5.0, em-websocket-0.4.0, eventmachine-1.0.3, eventmachine-1.0.0, ffi-1.7.0, ffi-1.3.1, forge-0.5.0, formatador-0.2.4, fssm-0.2.10, fssm-0.2.9, guard-1.8.0, guard-1.7.0, guard-1.6.1, guard-1.3.3, guard-livereload-1.3.0, guard-livereload-1.2.1, guard-livereload-1.1.3, guard-livereload-1.0.1, hike-1.2.2, hike-1.2.1, http_parser.rb-0.5.3, json-1.7.7, json-1.7.6, json-1.6.5, less-2.3.2, less-2.2.2, less-2.0.8, libv8-3.16.14.1, libv8-3.11.8.13-x86-linux, libv8-3.3.10.4-x86-linux, listen-1.0.2, listen-0.7.3, listen-0.7.2, lumberjack-1.0.3, lumberjack-1.0.2, method_source-0.8.1, multi_json-1.7.2, multi_json-1.5.0, open4-1.3.0, pry-0.9.12.1, pry-0.9.12, pry-0.9.11.4, rack-1.5.2, rack-1.5.0, rack-1.3.5, rake-10.0.4, rake-10.0.3, rake-0.9.2.2, rb-fsevent-0.9.3, rb-inotify-0.9.0, rb-kqueue-0.2.0, ref-1.0.4, ref-1.0.2, rubygems-update-2.0.3, rubygems-update-1.8.25, rubyzip-0.9.9, sass-3.2.8, sass-3.2.7, sass-3.2.5, sassy-buttons-0.1.4, slick-buttons-0.0.6, slop-3.4.4, slop-3.4.3, sprockets-2.9.3, sprockets-2.9.2, sprockets-2.8.2, sprockets-2.0.3, sprockets-helpers-1.0.1, sprockets-helpers-1.0.0, sprockets-helpers-0.8.0, sprockets-sass-1.0.0, sprockets-sass-0.9.1, sprockets-sass-0.3.0, stitch-0.1.6, therubyracer-0.11.4, therubyracer-0.11.3, therubyracer-0.9.9, thor-0.18.1, thor-0.17.0, thor-0.15.4, tilt-1.3.7, tilt-1.3.3, yui-compressor-0.9.6] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/cap:22:in `<main>'
I'm a noob with Capistrano and Ruby
Any idea to resolve this problem ?
Thx

Probably what's going on is that you installed Capistrano as the root user. However, running capify from a non-root user account is trying to find Capistrano installed for that specific user rather than a system-wide install.
Can you run simply
gem install capistrano railsless-deploy capistrano-ext
As the user, without Sudo?
To answer your comment: It's generally not best practice to be installing and running cap deploy scripts as the root user. For your purposes maybe it will be OK, since you are doing a very limited task with Ruby/Cap; in the future, I would recommend looking into something like RVM.
RVM (Ruby Version Manager) is a tool you will be able to install system-wide, that then will manage your ruby version and gems per user.

Related

bitbake error in do_rootfs: systemd depends on update-rc.d

I got a bit stuck debugging a yocto build problem. I encountered this while updating from yocto warrior (2.7) to yocto dunfell (3.1) The build fails during the building of the rootfs, all steps before seem to work:
ERROR: my-project-develop-1.0-r0 do_rootfs: Could not invoke dnf. Command '/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/rootfs/etc/yum.repos.d --installroot=/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/rootfs --setopt=logdir=/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/temp --repofrompath=oe-repo,/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/oe-rootfs-repo --nogpgcheck install base-version-develop bash cairo cantarell-fonts cellular-geolocation commit-hashes-develop crda curl disable-airplane-mode disable-power-saving-for-some-devices disconnect-wifi-without-connectivity dnsmasq dosfstools e2fsprogs e2fsprogs-resize2fs firmware-develop fit-conf gbs-overlay geofencing-db hostapd htop i2c-tools iw jq lateswap libgpiod libgpiod-tools linux-firmware-rtl8192cu matlab-develop modemmanager mosquitto mosquitto-clients nano network-configuration networkmanager openmoji-fonts os-release ostree ostree-devicetrees ostree-initramfs ostree-kernel packagegroup-base packagegroup-base-extended packagegroup-core-boot packagegroup-core-ssh-openssh parted psplash-raspberrypi pstree raspi-gpio rtwpriv run-postinsts set-modes-and-bands source-han-sans-jp-fonts special-shadow sqlite3tzdata u-boot-fw-utils userland weston weston-init wifi-configurator-frontend-develop wifilm811 wifilm843 wpa-supplicant locale-base-en-us' returned 1:
DNF version: 4.2.2
cachedir: /shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/oe-rootfs-repo
repo: using cache for: oe-repo
not found other for:
not found modules for:
not found deltainfo for:
not found updateinfo for:
oe-repo: using metadata from Tue 16 Feb 2021 08:59:38 AM UTC.
No module defaults found
--> Starting dependency resolution
--> Finished dependency resolution
Error:
Problem 1: package packagegroup-core-boot-1.0-r17.raspberrypi_cm3 requires systemd, but none of the providers can be installed
- conflicting requests
- nothing provides update-rc.d needed by systemd-1:244.5-r0.cortexa7t2hf_neon_vfpv4
Problem 2: package packagegroup-distro-base-1.0-r83.raspberrypi_cm3 requires packagegroup-core-boot, but none of the providers can be installed
- package packagegroup-base-1.0-r83.raspberrypi_cm3 requires packagegroup-distro-base, but none of the providers can be installed
- package packagegroup-core-boot-1.0-r17.raspberrypi_cm3 requires systemd, but none of the providers can be installed
- conflicting requests
- nothing provides update-rc.d needed by systemd-1:244.5-r0.cortexa7t2hf_neon_vfpv4
Problem 3: package packagegroup-base-1.0-r83.raspberrypi_cm3 requires packagegroup-distro-base, but none of the providers can be installed
- package packagegroup-distro-base-1.0-r83.raspberrypi_cm3 requires packagegroup-core-boot, but none of the providers can be installed
- package packagegroup-base-extended-1.0-r83.raspberrypi_cm3 requires packagegroup-base, but none of the providers can be installed
- package packagegroup-core-boot-1.0-r17.raspberrypi_cm3 requires systemd, but none of the providers can be installed
- conflicting requests
- nothing provides update-rc.d needed by systemd-1:244.5-r0.cortexa7t2hf_neon_vfpv4
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
It seems that systemd-1:244.5 depends on update-rc.d. This doesn't make a lot sense to me, since I don't need those scripts anymore when using systemd - maybe there are for some compatibility reasons? Puzzled by this I checked the reference and it seems that I have the right settings to use systemd exclusively:
$ bitbake -e exos-develop | grep "^DISTRO_FEATURES"
DISTRO_FEATURES="acl alsa argp bluetooth ext2 ipv4 ipv6 largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 vfat largefile opengl ptest multiarch wayland vulkan systemd weston wayland sota usrmerge systemd systemd pulseaudio gobject-introspection-data ldconfig"
DISTRO_FEATURES_BACKFILL="pulseaudio sysvinit gobject-introspection-data ldconfig"
DISTRO_FEATURES_BACKFILL_CONSIDERED="sysvinit sysvinit"
DISTRO_FEATURES_DEFAULT="acl alsa argp bluetooth ext2 ipv4 ipv6 largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 vfat"
DISTRO_FEATURES_FILTER_NATIVE="api-documentation"
DISTRO_FEATURES_FILTER_NATIVESDK="api-documentation"
DISTRO_FEATURES_NATIVE="x11 ipv6 xattr sota"
DISTRO_FEATURES_NATIVESDK="x11"
During debugging I also saw that poky's systemd recipe uses the update-rc.d.bbclass. From what I can see it only gets active when the DISTRO_FEATURES contain sysvinit, which is apparently not the case here. Maybe some caching issue?
Any ideas how I can debug this further?
I found it out myself (interesting how asking questions helps you thinking...):
The issue was in the systemd recipe itself and related to the systemd-compat-units recipe. I was able to fix it with this in my layer's recipes-core/systemd/systemd_%.bbappend:
# Disable all relations to update-rc.d:
PACKAGECONFIG_remove = "sysvinit"
RRECOMMENDS_${PN}_remove = "systemd-compat-units"
I'm still wondering how this issue came to be at all, though.
Would be great if somebody could explain why this happened at all.

How to debug the problem not able to translate OID with a new MIB file for UPS-MIB?

On Centos, I ran into the following error:
sudo snmptrap -v 2c -c read localhost '' UPS-MIB::upsTraps
MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs
Cannot find module (UPS-MIB): At line 0 in (none)
UPS-MIB::upsTraps: Unknown Object Identifier
The above error happened after
Copied UPS-MIB.txt to /usr/share/snmp/mibs
I started snmptrapd:
snmptrapd -f -Lo -Dread-config -m ALL
The version of the Net-SNMP is 5.2.x.
The same procedures work fine with Ubuntu 18.04/Net-SNMP 5.3.7.
I wonder how to debug and fix the problem?
Besides the Net-SNMP version difference, on Ubuntu, I found an instruction to install mib-download-tool, and execute it after the installation of Net-SNMP, and comment out the lines beginning with min: in snmp.conf in order to fix the error of missing MIB's.
However, for the Centos, I had no need and found no such instruction, thus I have not done it yet, as there is no error message of missing MIB's.
The MIB file is downloaded from https://tools.ietf.org/rfc/rfc1628.txt
renamed to UPS-MIB.txt (It seems to me that the name of the MIB file does not matter, as long as it's unique? I tried to use a different names, upsMIB.txt, rfc1628.txt, but it does not help to improve.)
I solved the problem as follows:
manually copied /usr/share/snmp/mibs/ietf/UPS-MIB on an Ubuntu with Net-SNMP 5.7.3 installed to the Centos /usr/share/snmp/mibs/UPS-MIB
then restart the snmpd
by the command:
service snmpd restart
then the OID of UPS-MIB becomes visible and accessible.
Maybe, the version that I downloaded from https://tools.ietf.org/rfc/rfc1628.txt is not suitable??

Could not find rake-12.3.0 in any of the sources (Bundler::GemNotFound) - Bitnami Redmine Stack 3.3.1-0 on Ubuntu 16.04.2 LTS

I am using the Bitnami Redmine Stack 3.3.1-0 on Ubuntu 16.04.2 LTS.
I recently installed a plugin (Issue Templates - http://www.redmine.org/plugins/redmine_issue_templates).
In the process, I updated the gems using bundle install and bundle update.
After performing this update, the Redmine website no longer works. I get the error:
"We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it shortly."
Upon analyzing the apache error log, I find the error:
"Could not find rake-12.3.0 in any of the sources (Bundler::GemNotFound)"
However, I have checked /opt/bitnami/apps/redmine/htdocs/vendor/ and /opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems and rake-12.3.0 is included in both locations. I am not sure why this issue is occuring.
I uninstalled the plugin and removed the files, but I still have the issue. I tried bundle install, bundle update, gem install rake -v '12.3.0', bundle exec rake rails:update:bin in the /opt/bitnami/apps/redmine/htdocs/ folder, and I also tried ./gem update in the /opt/bitnami/ruby/bin folder, but I still have the issue.
Please advise me what to do.
[ 2018-03-15 15:35:23.8349 28957/7f4ce96ec700 age/Hel/Req/CheckoutSession.cpp:252 ]: [Client 4-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 35671c4a. Please see earlier logs for details about the error.
App 4445 stdout:
App 4445 stderr: /opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/lib/phusion_passenger/config/system_metrics_command.rb:34: warning: Insecure world writable dir /opt/bitnami/ruby/bin in PATH, mode 040757
App 4445 stdout:
[ 2018-03-15 15:35:29.9175 28957/7f4ce86a9700 App/Implementation.cpp:287 ]: Could not spawn process for application /opt/bitnami/apps/redmine/htdocs/: An error occured while starting up the preloader.
Error ID: 16a39427
Error details saved to: /tmp/passenger-error.3ZEVOb
Message from application: <p>It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:</p>
<pre class="commands">bundle install</pre>
<p>If that didn't work, then the problem is probably caused by your application being run under a different environment than it's supposed to. Please check the following:</p>
<ol>
<li>Is this app supposed to be run as the <code>daemon</code> user?</li>
<li>Is this app being run on the correct Ruby interpreter? Below you will
see which Ruby interpreter Phusion Passenger attempted to use.</li>
</ol>
<p>-------- The exception is as follows: -------</p>
Could not find rake-12.3.0 in any of the sources (Bundler::GemNotFound)
<pre> /opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:88:in `block in materialize'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `map!'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `materialize'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/definition.rb:170:in `specs'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/definition.rb:237:in `specs_for'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/definition.rb:226:in `requested_specs'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:108:in `block in definition_method'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:20:in `setup'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler.rb:107:in `setup'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/bundler-1.16.1/lib/bundler/setup.rb:20:in `<top (required)>'
/opt/bitnami/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
/opt/bitnami/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
/opt/bitnami/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/lib/phusion_passenger/loader_shared_helpers.rb:278:in `block in run_load_path_setup_code'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/lib/phusion_passenger/loader_shared_helpers.rb:381:in `running_bundler'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/lib/phusion_passenger/loader_shared_helpers.rb:276:in `run_load_path_setup_code'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/helper-scripts/rack-preloader.rb:99:in `preload_app'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/helper-scripts/rack-preloader.rb:157:in `<module:App>'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/opt/bitnami/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.6/helper-scripts/rack-preloader.rb:28:in `<main>'</pre>
[ 2018-03-15 15:35:29.9342 28957/7f4ceaeef700 age/Hel/Req/CheckoutSession.cpp:252 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is 16a39427. Please see earlier logs for details about the error.
Did you load the Bitnami environment before running the "bundle" commands? There's a script at /opt/bitnami/ called "use_redmine". Please run it before running the commands.
For instance:
/opt/bitnami/use_redmine
cd /opt/bitnami/apps/redmine/htdocs/
bundle ...
Note: if you installed the Redmine Stack as superuser "root" on your Ubuntu, you need to load the environment using sudo /opt/bitnami/use_redmine

install mongo with chef

I've tried to figure out how to install a mongodb 3.4 instance using this chef cookbook. Nevertheless, I've not able to get to install it.
This is my mongodb.rb file content:
node.default['mongodb']['package_version'] = '3.4'
include_recipe 'mongodb::default'
And my metadata.db: depends 'mongodb', '~> 0.16.2'.
I've tried to verify it on centos-72 platform using kitchen verify centos-72. I'm getting this message:
ERROR: yum_package[mongodb-org] (mongodb::install line 77) had an error: Chef::Exceptions::Package: Version ["3.4"] of ["mongodb-org"] not found. Did you specify both version and release? (version-release, e.g. 1.84-10.fc6)
I'm realizing this cookbook tries to add this yum_repository:
yum_repository 'mongodb' do
description 'mongodb RPM Repository'
baseurl "http://downloads-distro.mongodb.org/repo/redhat/os/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}"
action :create
gpgcheck false
enabled true
end
And according to this mongo documentation the link repository should have to be:
https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
instead of
"http://downloads-distro.mongodb.org/repo/redhat/os/..."
The repo you are using does not have version 3.4 available. You can verify this manually by just looking at the RPMs in http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/RPMS/

Does "Placing binaries" mean building k8s successfully?

I follow this Getting started with Kubernetes on Mesos to try to build Kubernetes-Mesos:
git clone https://github.com/kubernetes/kubernetes
cd kubernetes
export KUBERNETES_CONTRIB=mesos
make
But executing make, it outputs following log:
$ make
hack/build-go.sh
+++ [1204 04:38:23] Building go targets for linux/amd64:
cmd/kube-proxy
cmd/kube-apiserver
cmd/kube-controller-manager
cmd/kubelet
cmd/kubemark
cmd/hyperkube
cmd/linkcheck
plugin/cmd/kube-scheduler
contrib/mesos/cmd/k8sm-scheduler
contrib/mesos/cmd/k8sm-executor
contrib/mesos/cmd/k8sm-controller-manager
contrib/mesos/cmd/km
cmd/kubectl
cmd/integration
cmd/gendocs
cmd/genkubedocs
cmd/genman
cmd/mungedocs
cmd/genbashcomp
cmd/genconversion
cmd/gendeepcopy
cmd/genswaggertypedocs
examples/k8petstore/web-server/src
github.com/onsi/ginkgo/ginkgo
test/e2e/e2e.test
+++ [1204 04:38:34] Placing binaries
$
So is the build success or not? I can't find useful prompt info.
Yes, that indicates a successful build.