Installing Scala Language on MacBook : Manually (No Brew or Coursier) - scala

I am trying to install scala language on my work laptop (mac). Could someone let me know the installation commands if I am unable to use brew or coursier? I have downloaded the package from github directly but unsure of next steps.
When using courier download as given on scala website I get this error:
Checking if the standard Scala applications are installed:
Exception in thread "main" coursier.error.ResolutionError$CantDownloadModule: Error downloading io.get-coursier:apps:latest.release
I have a feeling that my works security does not allow this installation. Is there a way around it / manual install for scala?
Homebrew I cannot download as I am not allowed to give out passwords during installation.

You can try the command listed on their site for the Mac installation:
curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-apple-darwin.gz | gzip -d > cs && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup
This should do everything on its own.
However, if you have admin rights, I recommend installing it via brew. Using brew is the most popular and easiest way, and you will use brew a lot on the Mac:
brew update
brew install scala
If you are not allowed to have admin rights, go to your IT department and have them install Scala for you via the brew command.
If this is not possible, you can simply download the Scala binaries. For example, assuming you want Scala 2.13.10, just download and unzip the scala-2.13.10.tgz zip file at your desired location. After that, you will have to set up your PATH manually, to be able to use the scala command in the command line:
export PATH=”/Users/your_user/scala/bin:$PATH”
Here's a more detailed tutorial on this approach.

Related

Linking postgresql in homebrew

I already installed postgresql, but it says I did not link to it.
I am running this in the command line and getting the following error:
myname#MacBook-Pro-8 ~> brew install postgresql
Warning: postgresql 10.4 is already installed, it's just not linked
You can use `brew link postgresql` to link this version.
myname#MacBook-Pro-8 ~> brew link postgresql
Linking /usr/local/Cellar/postgresql/10.4...
Error: Could not symlink share/man/man7/ABORT.7
/usr/local/share/man/man7 is not writable.
myname#MacBook-Pro-8 ~> sudo brew link postgresql
Password:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
I also tried:
brew prune; brew link postgresql
which gave me the same error:
Error: Could not symlink share/man/man7/ABORT.7
/usr/local/share/man/man7 is not writable.
Why is that folder not writable and what can I do to change that?
It was really painful solving this problem, so I figured I would leave it here for others to see.
Issue:
Homebrew install of Postgresql will not execute successfully. $ brew link postgresql results in failure due to directory not writable. New version of Homebrew will not allow sudo commands and System Integrity Protection prevents changing permissions.
Details:
I tried to use homebrew to install postgres and kept running into issues with syslink. When I ran $ brew link postgresql as homebrew suggested, I kept running into an error that it couldn't be completed because certain folders were not writable. I thought this would be easily remedied by running sudo but unfortunately the most current version of homebrew no longer allows the use of sudo commands due to security risks. My next thought was to my root user and use the macOS GUI interface to change the permissions on this folder because I am not sure how to do this on the terminal. Regardless of being logged in as 'root,' the OS would not let me change the permissions of the folder. I also attempted to use sudo and change the permissions in terminal and it did not work either. After several days of banging my head against the wall try all kinds of things to find a solution, I discovered that since El Capitan, macOS introduced System Integrity Protection aka 'SIP' or 'rootless.' As it turned out, once I disabled SIP, logged back into 'root' and changed my regular accounts permissions to Read/Write on the problem directories, I was able to go back to my regular account and successfully execute $ brew install postgresql.
(Assuming you currently have postgresql installed through homebrew but unable to link due a scenario like the one mentioned above, here is what I suggest to resolve your issue...)
Run $ brew link postgresql
Write down the directory path that the error says it is not able to write to. (e.g. usr/local/share/man/man7) NOTE: you'll want to actually write this down on paper or take a picture of the screen on your phone because you will not be able to use copy and paste)
Enable your 'root' user account if you have not already done so.
(instructions here) NOTE: make sure to make a really good password for this account and write it down somewhere safe. This is a powerful account and there's no way to recover the password.
Disable System Integrity Protection.
(instructions here)
Log into 'root' user account
In Finder menu bar select GO > GO TO FOLDER... (CMND + SHFT + G) and type in the path from Step 2.
Right-Click/ Cntrl-Click the folder and select Get Info
Click the plus sign at the bottom of Sharing & Permissions
Add your regular account to the list and change the permission to Read & Write
Go back to your regular account, run $ brew uninstall postgresql, then $ brew update and $ brew doctor . If those are all set run $ brew install postgresql.
You should be able to install without any problems now. However, if you run into a linking and permissions problem again, run $ brew link postgresql to figure out the problematic directory and repeat Steps 5 - 10 with whatever other directories are giving you trouble.
If everything is up and running properly. It is probably best to at least enable SIP again (instruction in the article linked in Step 4).
(To check that everything is working. I recommend running $ brew services start postgresql then $ createdb 'test' . In my case, it was when I originally tried to run createdb and got "command not found" that I realized something was wrong.)
Running this solves it. This gets around SIP.
sudo chown -R $(whoami) $(brew --prefix)/*
brew link postgresql

Completely uninstall Eclipse 4.7 version in RHEL 7.4 Maipo

I'm trying to uninstall the current version of Eclipse IDE in my RHEL machine by simply deleting all the files like:
sudo rm -rf ~/.eclipse
sudo rm -rf ~/eclipse-workspace
I also tried
sudo yum remove 'eclipse*'
However, these didn't seem to solve the purpose.
Any help will be appreciated, thanks!
Applications on Linux systems are most often installed using so-called packages, which are managed by a package management system. In the case of RHEL, packages use the RPM format, and the package manager of choice is a tool called yum.
Both installation and removal of software (packages) should be done using yum, so as to allow the package management system keep track of all installed files and current status. Therefore, you shouldn't try to remove software by simply deleting files from the file system. Instead, use the yum command. See the RHEL System Admin Guide for a detailed explanation of how to use yum to search, install, upgrade, and remove packages: Working with Packages.
You have tried the correct command (yum remove <package-name>), but you need to use the correct package name. On RHEL 7.4, the latest version of Eclipse is available as a part of the DevTools channel, and the package name is rh-eclipse47 (see Enabling the Red Hat Developer Tools Repositories). Note that you may have also installed an older version, which would be, for example, rh-eclipse46.
To find out what is the name of the package you have installed, you can run, for example, the following command:
yum list installed | grep eclipse
There is also the possibility that you installed the software not from an RPM package but manually, e.g. from a .tar.gz file distrubuted from eclipse.org. If that's the case, you will need to use the uninstaller program supplied with that distribution of the software.
Write command as:
rpm -qa|grep eclipse
This will give a list of installed packages. Remove all the packages by giving below command:
rpm -e *package-name*
Done!!!

How can I install the postgresql-contrib module in an existing database?

I'm using postgresql 9.1.6 on CentOS. I would like to install the postgresql-contrib module using a binary file, but I can't find it online. I'm unsure if I can install this after already installing postgresql. Is it possible to do this?
I installed postgresql in the following way:
wget http://ftp.postgresql.org/pub/source/v9.1.6/postgresql-9.1.6.tar.gz
tar -xzf postgresql-9.1.6.tar.gz
cd postgresql-9.1.6./configure --prefix=$HOME
make
make install
I am currently using the databases within this install and would prefer not to reinstall it (if possible).
I understand that once I install this I can use a function in the following way:
create extension tablefunc ;
EDIT: If I followed the instructions from here, does gmake and gmake install affect an existing database?
You might be hard pressed to find the contrib modules as binary distributions; however, the very page you linked has explicit instructions on how to build the contrib modules:
When building from the source distribution, these modules are not built automatically. You can build and install all of them by running
gmake
gmake install
in the contrib directory of a configured source tree; or to build and install just one selected module, do the same in that module's subdirectory.
Alternatively, you could try using yum (the package is postgresql-contrib.x86_64), but I can't vouch for the results of this if you installed Postgres from source.

pecl instal ibm_db2 fails

I need to install ibm_db2 extension for making php connection with db2. So I have used pecl. But it produces error.
$ pecl install ibm_db2
When I run this, the below error occurs.
.....
checking in /home/db2inst1/sqllib/lib64...
checking in /home/db2inst1/sqllib/lib32... found
checking for DB2 CLI include files in default path... checking in /home/db2inst1/sqllib... not found
configure: error: Please reinstall the DB2 CLI distribution
ERROR: `/tmp/pear/temp/ibm_db2/configure --with-IBM_DB2=/home/db2inst1/sqllib' failed
Please help.
download ibm_data_server_driver_for_odbc_cli_linuxx64_v97.tar.gz from ibm.com
untar the file into: /opt/ibm/
enter command > pecl install ibm_db2
When prompted for DB2 Installation Directory, use: /opt/ibm/odbc_cli/clidriver/
You need the DB2 headers to build the ibm_db2 PHP extension. They are included in the IBM Data Server Driver for ODBC and CLI.
before install ibm_db2, you have install expc, in the folder uncompress execute the script db2_install with root user: # ./db2_install
It asks for the installation path (e /opt/ibm/db2)
then install ibm_db2
Install a DB2 instance (On Ubuntu due to following instructions: http://www.db2teamblog.com/2010/09/db2-express-c-packages-for-ubuntu-1004.html) This will work also on newer systems.
After that run the following command:
pecl install ibm_db2
When prompted type:
/opt/ibm/dbs/V9.7/
and confirm the installation directory
The error is because in the path /home/db2inst1/sqllib not found the include folder.
you must download db2exc_974_LNX_x86_64.tar.gz, uncompress it (e. /otp/ibm/db2)
then install pecl install ibm_db2
DB2 Installation Directory? use this : /opt/ibm/db2
Check also the first comment on PHP manual by Jean Ferreira.
link
You need the APPLICATION DEVELOPMENT TOOLS when you install the client you should have the option to install them.
Check your /home/db2inst1/sqllib/include folder you'll see that you only have asn.h, a boatload of files is missing when you don't have the development tools installed.
Then use /home/db2inst1/sqllib as your install directory.
I lacked the APPLICATION_DEVELOPMENT_TOOLS in my DB2 installation (confirmed by only having asn.h in my includes folder)
To install the APPLICATION_DEVELOPMENT_TOOLS into an existing DB2 installation, follow these instructions
Check your product information. You will need this information later.
db2ls -p -q -b /opt/ibm/db2/V10.5
Download the appropriate Universal Fix Pack from IBM:
https://www-945.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm~Information%2BManagement&product=ibm/Information+Management/DB2&release=All&platform=Linux+64-bit,x86_64&function=textSearch&text=universal
Be sure to find the matching FixPack version (from the step above) and the correct architecture.
Save the file to /opt/ibm/fixpack
Gunzip/Tar the file
cd /opt/ibm/fixpack
gunzip /opt/ibm/fixpack/downloaded_pack.tar.gz
tar xvf /top/ibm/fixpack/downloaded_pack.tar
Create a response file /opt/ibm/fixpack/devtools.resp like this.
Replace the PROD value with the Product Response File ID
Replace the FILE value with the DB2 installation folder
PROD = DB2_SERVER_EDITION
FILE = /opt/ibm/db2/V10.5
LIC_AGREEMENT = ACCEPT
INSTALL_TYPE = CUSTOM
COMP = APPLICATION_DEVELOPMENT_TOOLS
Stop DB2 with db2stop or db2stop force
Run db2setup with the response code
cd /opt/ibm/fixpack/universal/
./db2setup -r /opt/ibm/fixpack/devtools.resp
Start DB2 with dbstart
When you are done, run pecl install ibm_db2
Use /home/db2inst1/sqllib as your install directory.
Original instructions were found here to install them into an existing DB2 installation (I used the 3rd option):
http://db2commerce.com/2014/02/11/installing-a-db2-component-after-the-rest-of-db2-is-installed/
I got solution for the above issue.
Need to select Custom Install while installing db2. So I just uninstalled and reinstalled DB2.
After that It works fine for me. Thanks everyone :)

Installing PDO-drivers for PostgreSQL on Mac (using Zend for eclipse)

How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.
I had to install the PDO_PGSQL driver recently on Leopard, and I ran across a multitude of problems. In my search for answers, I stumbled across this question. Now I have it successfully installed, and so, even though this question is quite old, I hope that what I've found can help others (like myself) who will undoubtedly run into similar problems.
The first thing you'll need to do is install PEAR, if you haven't done so already, since it doesn't come installed on Leopard by default.
Once you do that, use the PECL installer to download the PDO_PGSQL package:
$ pecl download pdo_pgsql
$ tar xzf PDO_PGSQL-1.0.2.tgz
(Note: you may have to run pecl as the superuser, i.e. sudo pecl.)
After that, since the PECL installer can't install the extension directly, you'll need to build and install it yourself:
$ cd PDO_PGSQL-1.0.2
$ phpize
$ ./configure --with-pdo-pgsql=/path/to/your/PostgreSQL/installation
$ make && sudo make install
If all goes well, you should have a file called "pdo_pgsql.so" sitting in a directory that should look something like "/usr/lib/php/extensions/no-debug-non-zts-20060613/" (the PECL installation should have outputted the directory it installed the extension to).
To finalize the installation, you'll need to edit your php.ini file. Find the section labeled "Dynamic Extensions", and underneath the list of (probably commented out) extensions, add this line:
extension=pdo_pgsql.so
Now, assuming this is the first time you've installed PHP extensions, there are two additional steps you need to take in order to get this working. First, in php.ini, find the extension_dir directive (under "Paths and Directories"), and change it to the directory that the pdo_pgsql.so file was installed in. For example, my extension_dir directive looks like:
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613"
The second step, if you're on a 64-bit Intel Mac, involves making Apache run in 32-bit mode. (If there's a better strategy, I'd like to know, but for now, this is the best I could find.) In order to do this, edit the property list file located at /System/Library/LaunchDaemons/org.apache.httpd.plist. Find these two lines:
<key>ProgramArguments</key>
<array>
Under them, add these three lines:
<string>arch</string>
<string>-arch</string>
<string>i386</string>
Now, just restart Apache, and PDO_PGSQL will be up and running.
Take a look at this PECL package: PDO_PGSQL
I haven't tried it myself, but I've been interested in playing with Postgres as an alternative to MySQL. If I have a chance to try it soon, I'll throw my results up here in case it helps.
I'm not sure this will help with the PDO drivers specifically, but you might look into BitNami's MAPPStack.
I had a ton of trouble with Postgres, PHP, and Apache on my Mac, some of it having to do with 64- vs 32-bit versions of some or all of them. So far, the BitNami MAPPStack install is working nicely in general. Maybe it will help with your PDO issues as well.
Install new php version via brew and restart server, and php -v, all issues are removed.
This is what worked for me
brew install php55-pdo-pgsql
This installs PHP 5.5.32 and PostgreSQL 9.5. I already had PostgreSQL 9.4 installed so I uninstalled the homebrew version with:
brew uninstall postgres
You then have to update /etc/apache2/httpd.conf to point to the correct PHP version and restart Apache:
LoadModule php5_module /usr/local/Cellar/php55/5.5.32/libexec/apache2/libphp5.so
My OSX version is Yosemite.