what do I need to manage zurb-foundation gems? - zurb-foundation

I have multiple projects using different versions of zurb-foundation. I want to use the sass/compass implementation. We have multiple people working on these projects and we need consistent authoring environments.
We aren't creating gems or anything like that, just html/css/jquery stuff. I want to be able to set up a watch on the command line to auto-compile the css and reload the browser if possible. When we are ready for launch, we'd like to minify everything.
Right now if I try to start a new project with the latest version of Foundation, all the other projects get upgraded. And since some upgrades break certain things - I don't want that. Also if we have new people added, they have to install specific versions of everything. It seems like a package manager is needed.
But every time I read about some kind of package manager, it seems like I have to install something else: ruby, homebrew, rbenv, bundler plus the zurb-foundation gem itself. The more research I do, the more confused I get.
Can someone please make a recommendation of what is needed, where it needs to be installed and in what order?

For Foundation 4, you can use the bundler gem. There are instructions on how to set up a Gemfile and install a specific Foundation version in the F4 official docs.
For Foundation 5, it depends on how you are using it. If you are using bower, you can specific a specific version number in the bower.json file and run bower install or bower update.
There are a variety of other ways to handle this and things might be different if for example you are using Rails, but these are the two best ways that I know of to get a specific version of Foundation installed.

To continue...
8 - NOW you can install ruby using rbenv. I looked up the latest stable version of ruby and it's 2.1.1. Groovy.
$ rbenv install 2.1.1
$ rbenv rehash
Checking...
$ruby --version
I got:
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Seriously? Now what? Oops - it's that nutty path thing again. add this to .profile
# Initialize rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
Quit and restart terminal. Check again:
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
Yaay! High fives! What was I doing again? Oh yeah - Foundation. Sigh.
9 - Go to http://foundation.zurb.com/docs/sass.html I already have Node.js installed - thank heaven - so now I install bower.
[sudo] npm install -g bower grunt-cli
10 - Now I install Foundation!
gem install foundation
But wait - there's more! That's 1.0.4. Should it be 5 something? Well no - that's the Foundation CLI.
11 - NOW I can create my project.
$ cd path/to/sites
$ foundation new MY_PROJECT
Now I finally have a project. Open in the browser....
I get an unstyled page:
Welcome to Foundation
We’re stoked you want to try Foundation!
To get going, this file (index.html) includes some basic styles you can modify, play around with, or totally destroy to get going.
Once you've exhausted the fun in this document, you should check out...
wah wah Well thanks ZURB! Yes I have exhausted the fun - but probably not in the way you intended.
12- Oh yeah - and bundler too so I can manage my old versions of Foundation
$ gem install bundler
So that's where I'm at. And all this so that updates are easier?
Was this ridiculously painful? You bet. And it's not like I'm exactly a noob here - I've done three sites with Foundation 4 - with and without compass - and one with Bootstrap.
Thanks ZURB - You guys may be geniuses but give the rest of us a break please!

It was a Magical Mystery Tour - and not in a good way - but I finally got it working. Thanks to Robert Anderson: http://blog.zerosharp.com/installing-ruby-with-homebrew-and-rbenv-on-mac-os-x-mountain-lion/
You are my hero! Although my experience started a bit further back...
Here's what I had to do:
1 - Update Xcode from the App store.
2 - Open and hit cmd-, and download command line tools.
2.5 - If you have the GitHub.app installed - uninstall it. It apparently interferes with command line operation, which really needs to be working for the rest of this.
3 - Install GIT. I'm using Mountain Lion and couldn't find an install package for that, but the snow leopard one worked. (http://sourceforge.net/projects/git-osx-installer/files/)
4 - Go to /usr/local
5 - Install Homebrew (http://brew.sh/) Do NOT use sudo.
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Now check the install:
$ brew doctor
I got a warning about an unbrewed .pc file fuse.pc - Just a warning so moving on...
$ brew update
If everything is installed correctly, this should run without errors.
6 - NOW you need to update your path, if you haven't already. Create ~/.profile if it's not already there. Add:
homebrew=/usr/local/bin:/usr/local/sbin
export PATH=$homebrew:$PATH
After wrestling with this file for awhile, and researching $PATH, I ended up editing /etc/paths and putting /usr/local/bin at the top of the stack. I think learning how to set your path is one of the keys to getting this done.
7 - Now use Homebrew to install rbenv. rbenv lets you have more than one version of ruby running on your machine. You need this because OSX ships with an old version of ruby that isn't supported by F5. yaay.
$ brew install rbenv
$ brew install ruby-build

Related

What will happen to rails app if I delete rvm?

I'm working on making my first very simple rails app, and I think I'm running into trouble because I have both rvm and rbenv installed.
I'm not actually sure if it's related to that, but I thought it might be --
I'm trying to run the command: sudo rake gems:install
and I'm getting this error message:
Could not find rake-11.1.1 in any of the sources
I ran bundle update rake and bundle install, and when I write 'which rake' - I get this: (which is why I thought it might be related to the fact that I have both rvm and rbenv included in my bash_profile)
/.rvm/gems/ruby-2.1.2/bin/rake
If this is the issue --- what will happen if I uninstall rvm? I don't really understand what it does well enough to understand what it will do to my existing code.
Thanks!
rvm is a great toolset for managing multiple ruby versions. I think of it like a tackle box for fishing: You've got different ruby versions, 1.9.3, 2.0.0, 2.2.3, etc. like the layers on the tackle box. rvm keeps a different directory for each version of ruby you have installed.
If you rvm use 2.2.3 you're telling your shell to point to ~/.rvm/rubies/ruby-2.2.3/bin/ruby (check which ruby to be sure).
If you rvm use system and then which ruby you'll see /usr/local/bin/ruby, or the system-installed version
You can put different gems (tackle/bait/tools) in each one. This is immensely useful if you're developing on multiple ruby apps/gems at the same time.
If you rvm implode you'll clean all the .rvm/ruby installs out of your system. This is a good, safe way to keep your system ruby untainted, which is more of a hassle to reinstall.
Go ahead and try reinstalling rvm and bundle-installing.

Matplotlib install issues. Pip Centos - Freetype "Missing" when it is installed

I am using a virtualenv for a django setup. I am trying to build a view that pulls data from logs and then graphs the data. Eventually I would like to have this real-time and live. If you have any recommendations on other solutions that would suit my project best, please do not hesitate to include them in the comment fields below.
I have attempted to install matplotlib from pip using pip install matplotlib.
I receive the following message:
* The following required packages can not be built:
* freetype
I then validated that it was installed
yum install freetype
Package freetype-2.3.11-14.el6_3.1.x86_64 already installed and latest version
I then found that there is a python-matplotlib which is an older version .99. However, I want to keep this inside of the virtual environment and not system wide.
find / -name *freetype*
/var/lib/yum/yumdb/f/d2807dcfe3762c0b9f8ef1d9bf0f05788e73282a-freetype-2.3.11-14.el6_3.1- x86_64
/usr/lib64/libfreetype.so.6.3.22
/usr/lib64/libfreetype.so.6
/usr/share/doc/freetype-2.3.11
I searched all over stackoverflow and only saw solutions for ubuntu which did not transfer over to centos.
Thank you for your time,
John
pip is going to compile matlibplot on your local machine, so you'll need freetype development headers installed as well.
CentOS 6+, Fedora, etc.:
$ sudo yum -y install freetype freetype-devel libpng-devel
On older operating systems (e.g. CentOS 5), you may run into a more specific freetype versioning issue with newer releases of matlibplot. If you're version agnostic, sticking with a legacy 1.3.x release will negate these dependency issues:
$ pip install matplotlib==1.3.1
Please note, you may need to downgrade your numpy to 1.8 in order to make matplotlib 1.3 work.
$ pip install numpy==1.8
Good luck!
I have just had a similar (albeit not exactly the same) situation. I'll write it up here as this page comes up among the first search results.
CentOS 5
pip install matplotlib complains about freetype
Both freetype and freetype-devel are installed.
~/.pip/pip.log provides the explanation of the problem. There is the line:
freetype: no [Requires freetype2 2.3 or later. Found 2.2.1.]
Obviously, the solution is either to upgrade freetype or downgrade matplotlib.
The second is easier (assuming I am OK with the older version).
pip install matplotlib==1.3.1 works fine.
On the matplotlib installation, this is what I did. Not sure if this is going to help you. Just followed the steps here:
http://pkgs.org/centos-6/centos-x86_64/python-matplotlib-0.99.1.2-1.el6.x86_64.rpm.html
I did not use pip, btw and have CentOS 6.4.
I had this happen to me in two different situations, see if yours is one of them:
freetype was installed, but not in the $PATH yet. Just exiting the shell and starting a new one fixed this.
I was building matplotlib from source, and trying to build from the master branch. After I switched to v1.3.x it correctly detected freetype.

Install Spatialite for python (GeoDjango) on OS X

I am tearing my hair out trying to install Spatialite for GeoDjango!
I am already using Homebrew, it's generally easy and convenient so I initially tried to follow the Homebrew instructions for GeoDjango.
But this stops short of installing any database, i.e. Spatialite. The next step is to try and install Spatialite itself, but there are no Homebrew-specific instructions provided by Django docs.
I found this tutorial which looks perfect - a Homebrew and virtualenv-friendly install of Spatialite for GeoDjango.
But it doesn't work... it appears that my pysqlite is linked against the non-spatial-enabled version of SQLite that comes with OS X, rather than the Spatial-ised one I installed from Homebrew, I get this error when Django tried to connect to the db:
"The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite."
The author of pysqlite hasn't responded to my pleas for help on Github and I haven't found anything via Google.
So I went back to the drawing board and decided to follow the "Mac OS X-specific instructions" in the GeoDjango docs... by installing the various geo libs from the KyngChaos binary packages.
The docs say "Install the packages in the order they are listed above" but I found I couldn't install UnixImageIO without installing PROJ first. The link in the docs to download Spatialite binaries (http://www.gaia-gis.it/spatialite-2.3.1/binaries.html) is broken so I used the "Spatialite Tools v4.1" from KyngChaos instead.
Proceeding to the next step I get this error:
$ spatialite geodjango.db "SELECT InitSpatialMetaData();"
SQLite header and source version mismatch
2013-10-17 12:57:35 c78be6d786c19073b3a6730dfe3fb1be54f5657a
2013-09-03 17:11:13 7dd4968f235d6e1ca9547cda9cf3bd570e1609ef
Not really sure what's wrong at this point.
There is someone else here on SO who has gone the KyngChaos route and just ends up with the same "Both SQLite and pysqlite must be configured to allow the loading of extensions" error I got from the Homebrew route anyway.
I found this ticket #17756 for adding pyspatialite support to Django - pyspatialite is supposed to be an easier way to pip install everything but unfortunately it doesn't work either (see comments towards bottom of ticket).
I'm a bit reluctant to start trying to build everything from source by hand as it seems likely I'll just run into the same problems again, but spending hours Googling for info about cryptic compiler errors, magic flags and paths etc along the way.
I'm about ready to give up and just use Postgres/PostGIS.
I was able to get this working now, using the tip here:
https://github.com/ghaering/pysqlite/issues/60#issuecomment-50345210
I'm not sure if it was using the real paths that fixed it, or just the Homebrew kegs or underlying packages have been updated and now install cleanly. Still, it works now.
I reproduce below the steps I took:
brew update
brew install sqlite # 3.8.5
brew install libspatialite # 4.2.0
brew install spatialite-tools # 4.1.1
git clone https://github.com/ghaering/pysqlite.git
cd pysqlite
(where brew reported I had existing versions I unlinked them and installed the latest as commented above)
then edited setup.cfg to comment out #define=SQLITE_OMIT_LOAD_EXTENSION and specify the paths:
include_dirs=/usr/local/opt/sqlite/include
library_dirs=/usr/local/opt/sqlite/lib
activated the virtualenv where I want it installed, then
python setup.py build
python setup.py install
(build_static still fails with clang: error: no such file or directory: 'sqlite3.c')
(maybe I should have done pip install . as suggested in the github issue)
now the spatialite geodjango.db "SELECT InitSpatialMetaData();" succeeds, albeit with an ignorable error:
InitSpatiaMetaData() error:"table spatial_ref_sys already exists"
i.e. it's probably not even necessary to run that command
When I was istalling this i follow this instructions https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/spatialite/#pysqlite2
pysqlite2
If you’ve decided to use a newer version of pysqlite2 instead of the sqlite3 Python stdlib module, then you need to make sure it can load external extensions (i.e. the required enable_load_extension method is available so SpatiaLite can be loaded).
This might involve building it yourself. For this, download pysqlite2 2.6, and untar:
$ wget https://pypi.python.org/packages/source/p/pysqlite/pysqlite-2.6.3.tar.gz
$ tar xzf pysqlite-2.6.3.tar.gz
$ cd pysqlite-2.6.3
Next, use a text editor (e.g., emacs or vi) to edit the setup.cfg file to look like the following:
[build_ext]
#define=
include_dirs=/usr/local/include
library_dirs=/usr/local/lib
libraries=sqlite3
#define=SQLITE_OMIT_LOAD_EXTENSION
I had the same error: SQLite header and source version mismatch.
For me it was enough to update libsqlite3-dev.
After that invoking $ spatialite geo.db "SELECT InitSpatialMetaData();" creates proper database.

Specify which version to install with macports

I would like to install a specific version of gdb and gcc with macports on mac os x leopard, not the last one, but the 6.8 for gdb. Is it possible?
It is possible. It's just convoluted and tedious. It's listed in the documentation these days.
Steps
Go to macports trac and find the package you're looking for. This is the link for subversion, which is the package I'll be using in the example.
Click the PortFile
Click Revision Log (top right)
Pour through the revisions until you find the version you're looking for. Remember the revision number.
In this example I'm looking for version 1.7 of subversion.
With that revision number noted. You need to checkout the version of that subdirectory at that revision.
cd /tmp
svn co http://svn.macports.org/repository/macports/trunk/dports/devel/subversion --revision 106629
Then cd into the folder and run the install
cd subversion
sudo port install
Then it should become selected by default. You can check with
sudo port installed subversion
The following ports are currently installed:
subversion #1.7.10_0 (active)
subversion #1.8.8_0
subversion #1.8.10_0
As I just came across this question when trying to figure out how to download an older version of curl, I thought I'd share an update:
The currently accepted answer did not work for me any longer. This is with MacPorts 2.2.0. What I did was the following.
I started following the directions located here. I ended up using the SVN method, since the first method didn't work. What I didn't realize is that I was missing a critical step.
I found another post that suggested moving the downloaded directory to /private/tmp. After doing this, I cd into the new directory and after a sudo port install I was able to install the older version.
I am on a Mac running OS X 10.8, so your mileage may vary.
This post is old.. but specifying a version is possible. For example I want to install ZeroMQ version 3.2.2 so I use:
sudo port install zmq #3.2.2
And it always helps to goto the MacPorts website and search to see if they have what you are looking for.
As far as I know it is not possible at all to install other versions than the exact version, unless there is a specific port for a certain version.
The only thing you could do is fetch the portfile of the desired version from the Macports subversion repository.
In your case only gdb 7.2 is available on the current version, no variants and no other versions - sorry :)

Installing PostgreSQL and pyscopg2 on Snow Leopard

I'm still a complete beginner in the field of web development and I'm trying to set up the Django environment. I'm reading "the definitive guide to django" to start my practice.
I'm running Snow Leopard (10.6.2) on a macbook 2.1GHz. It came with Python 2.6.1. Since Snow Leopard cam with Python 2.6.1 preinstalled, so I didn't do any extra set up. Maybe it needs more setup, please let me know. But I've ran it, and it works.
I installed django straight right from the book. I've ran it, and so far it works.
The Database configuration is the one stifling me.
I tried installing MySQL with MySQLdb module for python, but it had complications with the difference between 32 & 64 bit architecture (either mysql had 64 and python had 32 OR vice versa; Either way, I couldn't figure it out). I've read many forums and tinkered with it for hours, still couldn't fix it and I just gave up.
So I tried the next best thing (or so I thought), Let's try to set up Postgre instead. So, I went to the official Postgre website and picked the Mac OS X installment package. I download it, extract it, and all it had was an ".app" installer and a "README". I ran the installer, blah blah blah, I followed the instruction, it did this, it did that. At the end, apparently Postgre is installed.
I didn't feel completely sure if it was installed, so I searched around the internet for some answers. Well, I found the official documentation for installing Django for Mac, but the steps to install
Postgre was completely different. Maybe the ".app" installer did most of the configuration listed in those steps, I don't know.
Then I went to the terminal and type in:
psql -V
(to check which version of Postgre I just installed)
AND
sudo -u postgres pg_ctl start
(to run the database)
'psql' or 'pg_ctl' commands could not be found. To me, this is kind of saying Postgre was not installed or there are some setup I still need to do.
So I started looking at the first steps of installing Postgre from the given instruction by Django (link above). From the instruction it says to edit the '~/.profile', even after unhiding all the files and directories, I still can't find it under my user directory.
At this point I'm just kind of frustrated and don't know where to go. I was wondering if I can get some direction/tips/howto/anythingreallyatthispoint.
I can't really install psycopg2 until I have Postgre running, but from the looks of it, it doesn't look so bad to install it (or so I hope).
Many Many thanks in advance for any help ^_^
-Tri
If you're just getting started, I would try sqlite first. It's file based, so there is almost no configuration. Later, if you want to upgrade to a real database, then it won't be any harder than what you're attempting now.
the easiest way to install these apps would be via macports (http://www.macports.org/). in my experience, the installation was fast and clean. the geodjango installation documentation has a good section on this: http://geodjango.org/docs/install.html#macports.
I suspect the only problem you are having is not setting path. Add this to your ~/.bash_profile:
export PATH=/Library/PostgreSQL/8.4/bin:$PATH
Now you should be able to run the command line tools like psql.
I just spent a couple hours going through multiple different walkthroughs. This was the one that eventually worked:
first install postgress with the dmg:
http://www.enterprisedb.com/products-services-training/pgdownload#osx
then follow this tutorial:
http://stubblog.wordpress.com/2009/06/07/installing-psycopg2-on-osx/
then put this in terminal export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib:$DYLD_LIBRARY_PATH
And I'm pretty sure those were the important parts of what I did..
if you get errors try sudo pip uninstall psycopg2 then sudo pip install psycopg2
if you keep getting errors about ".... something < 10.4", reinstall pip. I think I used something like brew install python to update python... if you don't have homebrew, get it. I'm pretty sure that's what got rid of that error.. it may have been a manual install of pip3 though.
Sorry this is all over the place, it should get you a bit closer though. At least, if you (like me) have had none of the other tutorials work.