React Native: should I install Cocoapods with gem or homebrew? - reactjs

The React Native docs recommend installing Cocoapods with sudo gem install cocoapods, but I'm used to using Homebrew and have seen elsewhere that people install it with brew install cocoapods. When I try installing it with Homebrew, I get this warning:
Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
What I Want To Know:
What's the difference, if any, between installing Cocoapods with sudo gem install cocoapods and with brew install cocoapods
If I install it with Homebrew, should I install the regular package or the cask? What's the difference?

macOS comes with a pre-installed version of Ruby. If you try to install a gem through pre-installed Ruby, you've to use sudo by default witch is not a good practice.
Another option is to install CocoaPods in your user-level directory by following instructions available on the Sudo-less installation section.
I would suggest you install CocoaPods using brew. It's a little cleaner option and you can update it easier.
The cocoapods cask is for CocoaPads App and the formula is for the CLI only version.

Answers:
In general sudo is not good idea (not recommended). One should not do it, i.e. if your system get stolen and/or get compromised. Cocoapods comes from a trusted source, so people usually tend to install cocoapods gem on root level. Which is what essentially sudo does.
brew is package manager for macOS and brew cask takes it a bit further. It makes the process of installing and updating apps (like: Skype, Chorome) more elegant and smooth. On this question you can read short and comprehensive replies from bfontaine and cellepo.

Related

Error when trying to do (sudo apt install flex bison): The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt [duplicate]

I was watching this, and, as you can see, the first command I am told to put in is:
sudo apt-get install python-setuptools
When I do this, it outputs:
sudo: apt-get: command not found
I have no idea why this is the case.
How can I resolve this so I am following the tutorial correctly?
Mac OS X doesn't have apt-get. There is a package manager called Homebrew that is used instead.
This command would be:
brew install python
Use Homebrew to install packages that you would otherwise use apt-get for.
The page I linked to has an up-to-date way of installing homebrew, but at present, you can install Homebrew as follows:
Type the following in your Mac OS X terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After that, usage of Homebrew is brew install <package>.
One of the prerequisites for Homebrew are the XCode command line tools.
Install XCode from the App Store.
Follow the directions in this Stack Overflow answer to install the XCode Command Line Tools.
Background
A package manager (like apt-get or brew) just gives your system an easy and automated way to install packages or libraries. Different systems use different programs. apt and its derivatives are used on Debian based linux systems. Red Hat-ish Linux systems use rpm (or at least they did many, many, years ago). yum is also a package manager for RedHat based systems.
Alpine based systems use apk.
Warning
As of 25 April 2016, homebrew opts the user in to sending analytics by default. This can be opted out of in two ways:
Setting an environment variable:
Open your favorite environment variable editor.
Set the following: HOMEBREW_NO_ANALYTICS=1 in whereever you keep your environment variables (typically something like ~/.bash_profile)
Close the file, and either restart the terminal or source ~/.bash_profile.
Running the following command:
brew analytics off
the analytics status can then be checked with the command:
brew analytics
As Homebrew is my favorite for macOS although it is possible to have apt-get on macOS using Fink.
MacPorts is another package manager for OS X:.
Installation instructions are at The MacPorts Project -- Download & Installation after which one issues sudo port install pythonXX, where XX is 27 or 35.
Conda can also be used as package manager. It can be installed from Anaconda.
Alternatively, a free minimal installer is Miniconda.
apt-get command is only available on Debian or Debian-based Linux distributions (such as Ubuntu, Linux Mint, Kali). It is not accessible on macOS. Alternatively, you can use package managers like Homebrew, MacPorts, and Nix. You can find equivalent commands for each as follows
brew install package_name
sudo port install package_name
nix-env -i package_name
Before installing above package managers, you need to install XCode first. Follow the operation instructions from this guide How to Fix "sudo apt-get command not found" Error on Mac Terminal.
Alternatively You can use the brew or curl command for installing things, wherever apt-get is mentioned with a URL...
For example,
curl -O http://www.magentocommerce.com/downloads/assets/1.8.1.0/magento-1.8.1.0.tar.gz

VOLTTRON install on ubuntu 18.04

Can I get a tip for what I am doing wrong trying to install VOLTTRON on an ubuntu tower?
When I git clone the repo I run into this issue.
git clone https://github.com/VOLTTRON/volttron
I just made a git gist since the tracback is too big for stack over flow. Its on the python3 bootstrap.py part of the install
It looks like you may not have installed all of the required system dependencies; see: https://volttron.readthedocs.io/en/latest/setup/VOLTTRON-Prerequisites.html#volttron-prerequisites
You should get the g++ compiler as part of the build-essential package.

How do I install libDb from source on OSX

I cloned this repo and then...
cd build_unix
../dist/configure
make
sudo make install
Then I go to the project I am trying to compile and run stack install I get the following...
Configuring BerkeleyDB-0.8.7...
Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: Missing dependency on a foreign
library:
* Missing C library: db
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
This is on OSX
Rather than compiling from source, you could use homebrew:
brew install berkeley-db

Installing a php extension with Macports

I would like to install the php-intl extension for PHP on my Mac. I know the current PHP installation was installed with the OS (Mac OS X 10.6).
So I am wondering if I install the php5-intl package using Macports, will it install a second version of PHP (which I don't want), or will it upgrade my existing installation?
If I can't upgrade my current PHP installation that way, how can I proceed?
Installing the MacPorts php5-intl port will install PHP's intl extension for use with MacPorts php5, which it will also install; you'll also get MacPorts' copy of the apache2 server. MacPorts is designed to be self-contained; it's not designed to modify or integrate with any software components Apple provided with your OS. This is a good thing; Apple occasionally makes unexpectedly changes to their OS components which could break things installed by MacPorts.
If you want to give MacPorts apache2 and php5 a try, check out the MacPorts MAMP guide in the wiki.

libgtk version issue on ubuntu

I installed gtk+2.0 version 2.18.3 but when I run this command:
dpkg -i libgtk2.0-dev_2.18.3-1_i386.deb
I have the next error. But when I checked the /usr/lib/libgtk2.0-0 I found the version of the libgtk is 2.12.9.
Why the new installation not override the pre one? And what I should do now?
----------------------------------------ERROR------
Unpacking replacement libgtk2.0-dev ...
dpkg: dependency problems prevent configuration of libgtk2.0-dev:
libgtk2.0-dev depends on libgtk2.0-0 (= 2.18.3-1); however:
Version of libgtk2.0-0 on system is 2.12.9-3ubuntu5.
libgtk2.0-dev depends on libglib2.0-0 (>= 2.21.3); however:
Version of libglib2.0-0 on system is 2.16.6-0ubuntu1.2.
libgtk2.0-dev depends on libglib2.0-dev (>= 2.21.3); however:
Version of libglib2.0-dev on system is 2.16.6-0ubuntu1.2.
libgtk2.0-dev depends on libcairo2-dev (>= 1.6.4-6.1); however:
Version of libcairo2-dev on system is 1.6.0-0ubuntu2.
dpkg: error processing libgtk2.0-dev (--install):
dependency problems - leaving unconfigured
You can't just install a new libgtk package willy-nilly; you need to upgrade the packages that it depends on, at the same time (in this case, libglib, libcairo, and their respective dev packages).
(This question is more appropriate for Super User, and I've voted to migrate the question there.)
You probably want apt-get install libgtk2.0-dev=2.18.3-1, because most people really don't want to be in the business of manually managing package versions and dependencies.
But if that doesn't work, you'll need to manually look at the dependencies of libgtk2.0-dev (with apt-cache show libgtk2.0-dev) and download the matching versions of each package it depends on if they're not already installed (again, apt-cache show (dependency)).

Resources