Grails Mac OSX Install via Brew Restarting terminal - macos

I've been trying to get past step one of installing grails, which is bad i know. But the issue im having is getting grails to work via the OSX terminal. similar to node using brew I type the command
brew install grails
this retrieves grails and installs it, simple. to see if its installed correctly you type grails -version
However when i do that it's as though my terminal restarts. Its a hard thing to describe so here is a link to a youtube video that shows you what happens. I have JAVA installed and working. Anyone have an idea?
https://www.youtube.com/watch?v=ButLwGfBTZo

As this is the first excursion I have had into any Java related development. I made a rookie mistake and was unaware of vital piece of information. You do not need Java to run Grails you need the Java Development Kit (JDK). Which is a different thing completely apparently.
Available here
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Once installed run this command in the terminal /usr/libexec/java_home -V This will show you all of the current Java Virtual Machines installed. In my case
Matching Java Virtual Machines (1):
1.8.0_11, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home
You then need to set your JAVA_HOME Environment variable to point to your JVM. Like so export JAVA_HOME=$(/usr/libexec/java_home) use /usr/libexec/java_home rather than the true location as this will specifi the version set in Java Preferences for the current user. The source for that nice little trick is here http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/
Once you've done that you can type the command brew install grails or gvm install grails which is what i should probably use rather than brew as "SurrealAnalysis" rightly pointed out in one of the answers.
moment of truth grails -version and i got a response Grails version: 2.4.3... sweet.
Thank you all for the replies and help.

Following previous post, GVM it is not available in Homebrew, because of this.
GDK is also now officially SDKMAN!.
So, the steps would be:
curl -s "https://get.sdkman.io" | bash
source "/Users/{YOUR_USER_NAME}/.sdkman/bin/sdkman-init.sh"
sdk install groovy
Hope it helps! :)

Related

How to install old version (1.8.3) of docker on OS-X?

There is a nasty bug in Docker 1.9.x that is causing java
processes to hang and frankly hang up the entire container
instance, spinning 100% CPU.
I currently have docker 1.9.1 installed because that is all that
the docker install tool will install. There is no opportunity during
the install process to select any other version.
This is completely preventing me from building a cordova
build container. In my internet research I have found many
others who are encountering the same problem.
I've done some research and seen that others are reporting this
problem does not occur with Docker 1.8.3.
I've searched in vain for some hints on how to install older versions
of docker on OS-X. I tried replacing the boot2docker.iso in ~/.docker/machine/machines/default with the 1.8.3 version downloaded
from here: https://github.com/boot2docker/boot2docker/releases/tag/v1.8.3 but that fails miserably. I am guessing that there are other things about my default machine (which had been created with 1.9.1) that are incompatible with it.
If anybody has hints as to how I could create a new machine or modify
the existing machine to work with 1.8.3 I would very much appreciate
it.
Alternatively, let me know if there is some other installation method that would allow me to specify which version of docker to install.
I figured out that what I needed to do is to find an older version of DockerToolbox and that would install the version of docker that I wanted.
I went to the github repository for DockerToolbox:
https://github.com/docker/toolbox/releases?after=v1.9.
and there I found a link to the 1.8.3 binary:
https://github.com/docker/toolbox/releases/download/v1.8.3/DockerToolbox-1.8.3.pkg
I still had to uninstall my previous installation of docker so I followed the uninstall instructions on this page:
https://medium.com/#itseranga/install-old-version-of-docker-osx-c92ebd5f15f7#.5qh1z0ino
Once I had uninstalled and reinstalled via the legacy DockerToolbox, I managed to build the cordova container:
https://github.com/oren/docker-cordova
without incident.
I've been using the following:
https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-.tgz
See https://github.com/docker/for-mac/issues/1120.
If you happen to know the build number (e.g. 14937) -- not the git commit you see when running docker --version or docker version -- you can form the URL:
https://download.docker.com/mac/{{ beta | stable}}/{{ version }}.{{ build number }}/Docker.dmg
# example:
https://download.docker.com/mac/stable/1.12.6.14937/Docker.dmg

-bash: scala: command not found

I'm trying to install scala on my mac (Maverick).
I downloaded and unarchived it.
I then put myself from where it was unarchived and inside the /bin folder in the terminal.
But when I run "scala" or "scalac" I get :
-bash: scala: command not found
Why?
I always suggest that mac users install homebrew and use homebrew as their primary package installer to install software.
Installing scala is as simple as
brew install scala
Homebrew will also install/fix java dependencies for you and handle path issues (I believe)
I get the same issue and quickly I found everything is fine, if you write the correct path into your .bash_profile.
The only thing you need is to close current terminal and open a new one, on which Scala would work.
Hope this work for you.
do you have Java installed and available on your PATH http://sourabhbajaj.com/mac-setup/Java/README.html the same author also provides good Scala / SBT setup info http://sourabhbajaj.com/mac-setup/Java/README.html

How do I check Grails is installed on a Mac OS?

I installed Grails on a Mac OS using the gvm.
I did:
gvm install grails version 2.2.1
I want to satisfy my paranoia and confirm grails is installed. Is there something like a grails -version equivalent?
Or what is the easiest way to check?
grails
or
grails --version
or
grails help
grails --version
More information can be found at grails.org
i agree to Fran GarcĂ­a. just use gvm.
install gvm with
curl -s get.gvmtool.net | bash
then install grails with
gvm install grails 2.3.0
then you can check grails with
grails -version
just use :
$ gvm current grails
Using grails version 2.2.0
the cmd will show all the tools installed by gvm.
see the doc for more. http://gvmtool.net/
with following command you can locate where exactly grails is installed.
>which grails
>/Users/techtalks/.gvm/grails/2.4.0/bin/grails
grails --version
This should help you get the version of grails
If I am not wrong the problem is you need to install grails using gvm with the next command:
gvm install grails 2.2.1
Please note there is no version in the command
By just executing grails, it'll display the grails version anyway. But in order for grails to run or to give you its version with "grails --version" it needs to be in the path. On my mac, I have to open a new terminal in order to read the path after it is installed (or defaulted) by gvm. Maybe this is what's missing and you can't get the version
"grails -version" is the best way to check.
However, use the gvm framework to install/use different version of grails/ groovy/ gradle and other groovy based language.
This way, you could do a "gvm current grails" and see what is the version of grails you are using.
more info can be seen at http://gvmtool.net/
Also, if you have installed several grails, you can use:
gvm use grails --version
to change from one version to another.
The command
which grails
Will tell you if you have a grails distribution in your execution path.
The command
find / -iname *grails*
Will list all of your data whose name contains the 'grails' string (case insensitive).
Warning: while the former command is pretty quick, the latter could and probably will take a while to run.
Cheers,
Snoopy

Using Google App Engine SDK with Python 2.7 on Mac OS X 10.6

I need to run Python 2.7 on my Mac Snow Leopard, which has Python 2.6 installed. According to this answer, running the Python 2.7 mpkg installer from Python.org should get me there.
The reason I need to do this is that I'm trying to run the Google App Engine SDK for the Python 2.7 runtime.
After installing Python 2.7, I'm still getting the following warning in my GAE server log:
Warning: You are using a Python runtime (2.6) that is older than the
production runtime environment (2.7).
What else must I do to get the GAE SDK to recognize the new Python version?
EDIT 2:
Running:
$ sudo find / -name python2.7
I get:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/usr/local/bin/python2.7
According to the answers I went into GoogleAppLauncher -> Preferences and set the Python path to each of these, and each time I get the exact same error.
Running dev_appserver with the following flags:
--admin_console_server= --port=8081 Python command: /Library/Frameworks/Python.framework/Versions/2.7 2011-11-14
16:12:24.726 GoogleAppEngineLauncher[57590:203] *** NSTask: Task
create for path '/Library/Frameworks/Python.framework/Versions/2.7'
failed: 22, "Invalid argument". Terminating temporary process.
Another Wierd thing is, it always tries to resolve to the same path, no matter which of those I plug in; It always reverts to /Library/Frameworks/Python.framework/Versions/2.7
EDIT 3:
OK, after entering the paths into the prefs field repeatedly, I finally just cleared it out, and somehow it's now pointing to the right place:
Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /usr/local/bin/python2.7
Open the GAE launcher preferences and set the Python Path option to the fresh installed Python 2.7, in your case /usr/local/bin/python2.7 .
Came across this question looking for a solution to the same dilemma regarding Mac, GAE and Python.
One comment I would like to make regarding setting the Python path using GAE Preferences. I notice you mention that you had a problem setting the Python path using the Preferences. I discovered that after editing the path, you have to press Enter. Otherwise, the path doesn't get updated. This might explain the weirdness you were mentioning when trying to edit the path field.
I installed python 2.7.x from macports. I see this:
$ python --version
Python 2.7.2
$ which python
/opt/local/bin/python
So, in the preferences for GoogleAppEngineLauncher.app I set the python path to:
/opt/local/bin/python
In the console log, I see this:
*** Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /opt/local/bin/python
I still see some errors about libraries, in particular Can't open zipfile...setuptools but simple stuff at least seems to work.
Good luck!
I am not sure if it helps, but instead of using the binaries from Python, I used MacPorts http://www.macports.org/ and installed the Python 2.7 runtime:
sudo port install python27

Is there a nice and easy installer for Clojure on Mac OS (Leopard)?

I found the following guide:
http://mark.reid.name/sap/setting-up-clojure.html
but it seems like a whole lot of manual steps, and I bet it is out of date already. Installing ClojureBox on Windows was a breeze. Does anyone know of a simple installer for it? Where can I download it, and what are the steps?
Thanks!
EDIT: Tried installing cake, got:
$ sudo gem install cake
Password:
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302
Also tried installing using the script:
$ sudo ./cake_install.rb
http://github.com/ninjudd/cake-standalone/raw/master/jars/cake-0.5.4.jar
[=============================================================================]
http://build.clojure.org/releases/org/clojure/clojure/1.2.0/clojure-1.2.0.jar
[=============================================================================]
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file (ordered_set.clj:1)
EDIT 2: Now the Java version issues :) What version of Java do I need and where to download it?
$ sudo cake test
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file (ordered_set.clj:1)
My Leopard software is up to date :(
Apple Computer supplies their own version of Java. Use the Software Update feature (available on the Apple menu) to check that you have the most up-to-date version of Java for your Mac. If you have problems with downloading, installing or using Java on Mac, please contact Apple Computer Technical Support.
EDIT: Hm ... I suspect that one of the suggestions I tried broke my ability to connect to the internet (both wired as well as wireless) on Apple :(
Clojure is also installable via Homebrew:
http://github.com/mxcl/homebrew
brew install clojure
If you just want to run clojure programs, then macports works. Bear in mind you're dependent upon the maintainer to update versions.
If you plan on writing clojure programs, then cake is a better starting point. Installation involves one of the following (your choice):
Using gem (easiest)
gem install cake
Standalone script
Download the script
Put it somewhere in your path and chmod +x cake to make it executable
Git repository
git clone git://github.com/ninjudd/cake.git
Symlink bin/cake into your path and make it executable
Cake is a full build system, but you can just use it to fire up the repl by running cake repl. There's also leiningen, but starting repls will feel faster in cake since it uses persistent JVMs.
I find Leiningen very easy to use. Just download the script, put it somewhere in your $PATH (/usr/bin/ for example) and make it executable: sudo chmod +x lein.
Now type lein repl and Leiningen will download all the files you need and create a REPL for you. It's that easy.
You may want to check CounterClockWise (an Eclipse plugin). There's a video on how to install it here. It'll give you a lot of features to play with - including a clojure REPL.
Just checked this will still work under Ubuntu. It should be the same for macs, except using whatever macs use instead of apt-get to install maven:
http://www.learningclojure.com/2010/08/clojure-emacs-swank-slime-maven-maven.html
You need to install maven, create a file, then you can just call mvn clojure:repl and everything should just work.
If you'd also like the whole emacs-swank-slime setup that's also easy now, and described there.
If you try it can you comment back here or on the blog to let me know if there are any changes I need to make for macs?
Install MacPorts and then run sudo port install clojure
I once created a package called ClojureX that was partly based on Mark's article. It's not actively maintained anymore (at least not by me), but there's no reason it wouldn't work:
http://github.com/citizen428/ClojureX

Resources