Can't run cloned repository - github

How do I download my old code from github? I made a mistake on my app, and when I try to download the old zip file from github and run it I get an error.
I think I'm doing it right, don't I just need to clone the repository? When I do, i get this error when I try to run the server:
An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.
and when I run bundel install I still get the error.
I also get this error:
bundle install doesn't work and I still get the error along with this one:Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension

It ssems to me that you do not have install Postgres. Install it and try bundle install again.
How install Postgres on Ubuntu (of course you can have another system :) ) - https://help.ubuntu.com/community/PostgreSQL

If you have installed Mavericks, that is the source of your problem. I had to install another gem with native dependencies that needed to be compiled after I installed Mavericks, and some changes as to which compiler Mavericks uses to compile gem dependencies creates problems. In your case, I would suggest you pick one of the solutions in this answer to resolve your PG installation problems.

Related

Cannot use Swift on Ubuntu 18.04

After conscientiously following the install instructions on Linux from swift.org, I encounter an issue where it is not possible to compile anything on a Ubuntu 18.04 machine. The REPL seems to work but during compilation (when calling swift build) the following error appears:
/usr/bin/ld: cannot find -lstdc++
There are more details in the full bug report [SR-9093]. I don't know at all what to do to solve this issue, there are similar problems already mentioned in other bug reports, for instance on this really old one [SR-35].
What should I do?
Thank you
I am assuming that you had already installed the libstdc++ successfully and you have set the permissions properly. But I really doubt that it was installed correctly but it was installed with corruption of some sort. The corruption occurred because you didn't install libstdc++ via a package manager. Result was some form of weirdness in the package manager database which effected the overall functioning system. Exactly why adding something to a folder should change anything at all. I don't know why this happens, unless the folder is hot i.e symbolically linked to a program which doesn't have any tolerance for hacks like simply copying a file into the folder. So for now try to install the libstdc++ again. Below is the link to the file to again download the correct program and this is compatible with amd64.
http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.10_amd64.deb
And below are some link to help
https://ubuntuforums.org/showthread.php?t=1425470
https://ubuntuforums.org/showthread.php?t=808045
https://ubuntuforums.org/showthread.php?t=808045
https://packages.ubuntu.com/search?keywords=libstdc%2B%2B
https://packages.ubuntu.com/xenial/amd64/libstdc++6
Install libstdc++
sudo apt install libstdc++6
It seems possible that the apt install did not run the ldconfig program, which should be run to add the library to the list of those which ld.so knows about.
It looks like you can do it manually:
sudo ldconfig
IMPORTANT CAVEAT: I don't have Ubuntu and haven't been able to test this. And it's a sudo command. Run at your own risk, YMMV, etc.
If this does not work, it's possible that a file called /etc/ld.so.conf is not set up to search the directory where libstdc++ ended up. I wouldn't dare try to describe how to fix that.
sudo apt install -f
The command above should install any missing dependencies.

How do I install the hg-git plugin on Debian Stretch?

Debian Jessie, as well as sid, have a mercurial-git package which contains the hg-git plugin. However, this package was (auto-)removed from Debian Stretch to to a release-critical bug.
But - I need it installed and running. Surely this should be possible, right?
Well, I followed the installation instructions on the plugin page:
I ran apt-get install python-setuptools python-setuptools-git python4-setuptools python3-setuptools-git
I ran easy_install hg-git and it seemed to work
But still, when I run various mercurial operations I get, as the first line, the error message:
*** failed to import extension hgext.git: No module named git
(regardless of whether I'm doing anything git-related or not.)
My questions:
Why is this happening?
What do I need to do in order to make the error message go away while having hggit working?
Now,
How do I correctly install dulwich to get hg-git working on Windows?
Apparently, that critical bug doesn't manifest always (and perhaps only under very specific circumstances), so you can try installing the Debian sid version of the mercurial-git package (that is, version 0.8.11-1 at the time of writing). There's a SuperUser question about how to do this:
https://linuxaria.com/howto/how-to-install-a-single-package-from-debian-sid-or-debian-testing
my personal opinion in this case is to simply install the .deb file, which you can get from here (it's not platform-specific; at the link you'll need to choose a mirror.) That makes the error message go away, at least assuming you have:
[extensions]
hgext.bookmarks =
hggit =
in your ~/.hgrc file.

Installing Vapor on macOS without needing Homebrew

I am trying to get a Swift Vapor project started. Following the guide here, it seems that Homebrew is the only option. I already have MacPorts and prefer it in many ways to Homebrew. Unfortunately there is no port for Vapor, so I went for the SPM installation that Vapor people describe here. I had previous success with Kitura, so I thought why not with Vapor. Well, when you go and build your project, you get
$ swift build
[... build stuff ...]
note: you may be able to install ctls using your system-packager:
brew install ctls
[... more build stuff ...]
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "shim.h"
^
[... more like that ...]
/Users/morpheu5/web/vizex/api/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher+Method.swift:1:8: error: could not build Objective-C module 'CTLS'
import CTLS
^
<unknown>:0: error: build had 1 command failures
error: exit(1):/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/morpheu5/web/vizex/api/.build/debug.yaml
Apparently you really need this ctls package, and the only way of getting it appears to be through Homebrew/Tap.
I really don't want or need Homebrew, so how do I get to the bottom of this? I'd really like to give Vapor a try.
Obligatory 1: installing Homebrew is the easiest way. If you then decide you don't want Homebrew, it uninstalls quite neatly.
Obligatory 2: using a Linux VM is the second easiest way.
But to answer your question and manually install CTLS:
Make sure you have the libraries for LibreSSL or OpenSSL installed (using MacPorts, presumably)
Download the latest release of CTLS.
From the release archive, rename macos.pc to ctls.pc and then edit it using a text editor. Change the paths to point to your LibreSSL/OpenSSL installation.
Move the edited ctls.pc into your $PKG_CONFIG_PATH.
I have tested this and it works for me, with the caveat that I installed LibreSSL using Homebrew so I don't know where MacPorts will put it.

collectd-how to install write_riemann plugin

I'm new to collectd and Riemann. Im essentially trying to direct collectd logs to a riemann server instance. I understand that I need write_riemann plugin installed. I tried compiling the source files for write_riemann available online, but it includes a file called "riemann.pb-c.h", which is no where to be found. Please help!
Download the binary. After running the build script, while running the configure script include "--enable-write_riemann", this should install it. I had a lot of dependencies missing on CentOS, which threw a lot of errors. Once they were installed, write_riemann plugin was compiled and installed. Another issue you might face while installing the dependency is not able to find the right packages for protobuf-c.I was using yum package installer. Go to sudo vi /etc/yum.repos.d/epel.repo and change enabled from 0 to 1. After this, the protobuf-c processor was recognised while running the configure script. This solved my issue. Hope it does yours too!

How to run PHP 5.5.4 mcrypt run on CentOS 6.4?

I am getting the following error:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so' -
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by
/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so)
Does mcrypt require glibc 2.14?
We are running CentOS 6.4 (latest stable version of CentOS) and it comes with glibc 2.12 (can't really upgrade glibc as being a core part of OS, changing it will likely break lots of stuff)
How do I make my PHP 5.5.4 run mcsypt under these circumstances?
Current configuration (phpinfo output) is here.
I was also having issues installing mcrypt on my VPS dev server so I thought I would post my solution in the hopes that it helps someone. I am running Centos OS 6.5 and had upgraded PHP to 5.5.13 using the Webtatic EL yum repository. https://webtatic.com/packages/php55/
First shh into your server
ssh admin#domain.com
initially I was trying to do (which was not working):
yum update
yum install php-mcrypt
I then realized my mistake when I looked at php -v and realized php-common was conflicting as the above code was trying to load a dependency from 5.3.
I then executed the following correct commands:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum update
yum install php55w-mcrypt
service httpd restart
This worked perfectly for me.
I also read while researching this issue that some people did have to add the extension to their .ini file manually by adding the following line but i did not have to do this.
extension=mcrypt.so
you can find the location of your php.ini file by looking at phpinfo(); and see which configuration it is loading. For me the following ini files were loading:
/etc/php.ini
/etc/php.d/mcrypt.ini
/var/www/vhosts/system/domain.com/etc/php.ini
If the installation is successful then you will see the extension when you echo phpinfo();
Try installing php-mcrypt using yum. That should pull in any other libraries you need to run it.
yum install php-mcrypt
In light of your update, it would appear that you are trying to use the MCrypt extension built from another PHP Source which was created by an updated GLIBC library. The only proper solution I can see is the following:
You first need to ensure you have libmcrypt, libmcrypt-devel, and mcrypt installed before continuing. Check your CentOS repository.
Download the PHP Source from http://php.net
Untar the downloaded source tar -zxf php-5.5.4.tar.gz
cd into the source cd php-5.4.4
Copy your current ./configure string. The whole thing!
Add support for Mcrypt --with-mcrypt=/usr and run the new configure command
make && make install
restart Apache and PHP-FPM
This will keep your current configuration just as CentOS has built it but with the additional support of MCrypt as you are looking to have. Once you've done this, you do not need to enable the MCrypt extension in your php.ini file as it will be built into PHP itself and will be automatically loaded for you now.
When in doubt, you can also read up on the installation here http://us1.php.net/manual/en/mcrypt.installation.php