I'm not a developer by trade. Either by force or by chance, my job has introduced me to programming and software development in ways I stubbornly fought against for far too long.
My main reasons for resistance were simply a lack of understanding. I had this misled understanding of any programming (scripting included) as a headache I just didn't want. Who wants a program to not work because they didn't close a quote or forgot a curly bracket? I was content in hardware and operations all the while reading stories of the Bastard Operator from Hell and plotting my revenge on your typical end-user.
Enter now: Confidently developing in python and shell scripts growing daily to make my job easier. All with the intention of automating myself out of a job! Lets not forget that I'm now a part of a project with people I consider more friend than co-worker that will take all of us down a road filled with Groovy and Grails, most of us for the first time!
I work professionally on both a Mac and Windows. The Windows machine simply because I'm in a multiple OS environment but I certainly fought (begged) for a Mac from day 1. Prior to my current position, I haven't touched a windows machine in almost 10 years. Personally, I run Ubuntu. I adore the simplicity as well as the very extensive parental controls when it comes to internet browsing. My kids are now at the age where they know what YouTube is and want to see the Frozen Let It Go video (...again...) but I don't want them to inadvertently go to an inappropriate-for-an-8-and-10-year-old video instead.
I could create an entire blog post on things that make Ubuntu even more awesome than Mac for development. Sadly though, I'd be partially lying as well. As awesome as Ubuntu is, it is an open sourced project and some applications that just make life easier or more fun are only supported on one of the 2 mainstream operating systems. C'est la vie!
What Ubuntu is phenomenally great for is software development in general! Installation and setup is a piece of cake for any language you could possibly want. I could offer you the video series that actually helped to walk me through my own setup for Grails but who watches videos anyways? Especially when I'm actually willing to walk you through step by step.
For a word of warning: I'm a HUGE fan of the command line! GUI's and IDE's come and go and I don't feel like re-learning how to use the latest tool when the command line is constant. It's not to say that I don't use Eclipse (because I do), I just don't depend on it. With that said, these steps will also take you through installing everything from a terminal and NOT the application installer (software center).
From here out, I'll simply include typed out text I used for ease of copy/pasting. Basically ensuring you have a java jdk installed, setting the correct path and JAVA_HOME, installation of the grails IDE, & your first fast sample project! Or, you can skip all this and just watch the darn video reference!
First, you need to have a few pre-requisites installed. Java being key. All commands from the terminal:
java -version
should output something like:
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.4) (7u51-2.4.4-0ubuntu0.13.10.1)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
If you do *NOT* have java installed, the installer should give you a few options in which you CAN install with the command: sudo apt-get install <package_name>
java-version again once the install is complete should return the above output.
Now that THAT is done, let's install the GVM! ACK! More pre-req's! We need curl before grails.
sudo apt-get install curl
Ok, now lets get some grails!
curl -s get.gvmtool.net | bash
In case you didn't notice the obvious message in your terminal after installation saying 'please shutdown & open a new terminal', here is my PSA for tonight: Close your terminal out and open a new one before continuing!
After re-opening: gvm help <-- should return a fairly basic help screen but helps to ensure you gvm IS in fact installed.
gvm install grails <version number if you want. Nothing if you want latest>
Time to set some variables!
Later versions of Ubuntu will automatically append your $PATH as you add languages. Simple to check! One being your java -version. If that returns, your path is already set. Same with grails -version. If you get a return, your path has already been set. For reference, I'm running Ubuntu 13.10 and had no problems and did not have to fix my path.
From a command line perspective, your good to go! Lets set up a demo! Just for ease, it is usually best to create a 'grails' directory in your home,
mkdir ~/grails
cd grails
grails create-app demo <--this will download a bunch of files & move them in!
cd demo <--grails created this directory when you told it to create the demo above
grails run-app <--more downloading, will start web server, tomcat, etc... This will take a little bit of time - if my memory is correct, this took around 15-20 minutes. How do you know its done? At the end you will see 'Server Running. Browse to http://localhost:8080
Now, lets set up the Groovy/Grails Tool Suite!
You will need to download the GGTS here. And here is where I break my command line love. I went into the file manager once it was complete (took about 10 mins or so), downloads, extracted the tar.gz I just downloaded, and double clicked on the GGTS icon. That really is about all there is to explain. If you want more details or perhaps more into why your typing in what I told you to type, seriously, WATCH THE VIDEO!
Doing this allowed me enough to see a demo of staring up my own webapp, as well as installing the IDE to further allow me to play with containers and views and customization. I hope this helps for getting Grails started in an Ubuntu environment!
No comments:
Post a Comment