Any Success Compiling Ruby-odbc For Mac

Posted on
Any Success Compiling Ruby-odbc For Mac Rating: 4,1/5 6768 votes

Not much here, either. Just hanging out on Treehouse Island. How have you been?

How are things? Things are good here, too. You want to install the latest versions of Ruby, Rails, and MySQL on Lion? Ok, that’s cool, we can do that instead of watching the latest Twilight movie. We’re going to be using and to get this all up and running. This is a bit of an opinionated method of getting everything installed.

There are several ways of installing a modern Ruby and Rails environment and in the end, they all get you to the same place. Another popular option for getting ruby up and running is. For the purposes of getting everything up and running quickly, I find rvm to be a bit easier to use and explain so I’m going to use that. Another quick note: while these instructions are written for Lion, they should also work on Snow Leopard, particularly the osx-gcc-installer instructions. Install Developer Tools Before we install either Homebrew or rvm, we need to have a compiler installed. Xcode happens to come with one.

Open up the App Store and type “Xcode” in to the search box. Click install. This is a large download so go ahead and get some coffee or catch up on the latest meme on Reddit. Another option is to use the. This doesn’t install the Developer Tools from Apple, only the compiler. The instructions that follow should work with only that installed but I haven’t tested it. Besides, you’ll probably want to have the full developer tools installed so you can unlock the iOS foundations badge on.

Install Homebrew is “The missing package manager for OS X.” The other big package manager available on OS X is called. It’s also very good but we’re going to use Homebrew for the purposes of this article. A Word of Warning The instructions that follow run a shell script directly from a web site that you are not in control of. This is generally considered a Bad Thing™ and in general, you should at least review what the script is doing before you run it. We’re going to have to trust each other and the homebrew team that the script does what it’s supposed to do. Always think twice when you see something like this, though.

Nevertheless, we’re going to trust the homebrew team and run this script. I’ve run this several times before and it’s not like it’s a comment thread on YouTube. Moving On Open up the Terminal application that comes with OS X. This should be inside the “Utilities” folder in your main “Applications” folder.

Type the following: /usr/bin/ruby -e '$(curl -fsSL You should see a bunch of text going by at this point and having it seem like something is installing. If you see any error messages, double check to make sure that you’ve installed the Developer Tools correctly. Install Git This part should go by pretty quickly. Open up a terminal and type the following: brew install git You should now have git installed. You can verify by typing the following: git -version You should see: git version 1.7.7.2 That’s the latest version of git as of this writing.

If you don’t see something similar, double check that you’ve correctly installed the Developer Tools and Homebrew above. Install MySQL Now that you’ve got Homebrew installed, installing MySQL is pretty easy.

Success

In the same terminal, type the following: brew install mysql Again, you should see a bunch of text going by saying things like “Downloading,” “Patching,” “make” and the like. After it finishes, you should see a bunch of instructions. Let’s follow them, still in terminal: mysqlinstalldb -verbose -basedir='$(brew -prefix mysql)' -datadir=/usr/local/var/mysql -tmpdir=/tmp mkdir -p /Library/LaunchAgents cp /usr/local/Cellar/mysql/5.5.15/com.mysql.mysqld.plist /Library/LaunchAgents/ launchctl load -w /Library/LaunchAgents/com.mysql.mysqld.plist That should install mysql to run on startup of your system. Test it with the following at the command prompt: Note: The dollar sign in front of the mysql command denotes that we are at a shell inside of the terminal. It is not necessary to type it. $ mysql -uroot You should see the following: Welcome to the MySQL monitor.

Commands end with; or g. Your MySQL connection id is 75 Server version: 5.5.15 Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates.

Ruby-odbc

Other names may be trademarks of their respective owners. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. Mysql If you don’t see that, something went wrong in the install. Double check the instructions above and try again. Type “quit;” to exit the prompt. You’ve installed msyql.

Install RVM is the Ruby Version Manager. It lets you easily switch between different versions of Ruby on the command line. Remember what I told you a few paragraphs above about not running untrusted shell scripts? We’re going to do it again.

Open up terminal again and type the following to install rvm: $ bash. Thanks for the write up Jason, unfortunately I’m receiving the same error as another user here. The installation stops when installing Ruby 1.9.3. This is the problem i am having new-host: myname$ rvm install 1.9.3-p0 Installing Ruby from source to: /Users/myname/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s) ruby-1.9.3-p0 – #fetching ruby-1.9.3-p0 – #extracted to /Users/myname/.rvm/src/ruby-1.9.3-p0 (already extracted) Fetching yaml-0.1.4.tar.gz to /Users/myname/.rvm/archives Extracting yaml-0.1.4.tar.gz to /Users/myname/.rvm/src Configuring yaml in /Users/myname/.rvm/src/yaml-0.1.4. Compiling yaml in /Users/myname/.rvm/src/yaml-0.1.4. Installing yaml to /Users/myname/.rvm/usr ruby-1.9.3-p0 – #configuring ERROR: Error running ‘./configure –prefix=/Users/myname/.rvm/rubies/ruby-1.9.3-p0 –enable-shared –disable-install-doc –with-libyaml-dir=/Users/myname/.rvm/usr ‘, please read /Users/myname/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has been an error while running configure. Halting the installation.

I’d recommend creating RVM gemsets and.rvmrc files for each of your projects e.g. Cd myproject rvm –rvmrc –create ruby-1.9@myproject That creates a gemset specific for that project, all gems used by that project will be held in that local gemset. The.rvmrc file will automatically switch your terminal session to the correct gemset each time you enter the project directory. You can add additional things to your.rvmrc file, such as checking your gemfile and running bundler if it’s changed.

Combined with Guard that works pretty well to make sure your gems are in line with your Gemfile at all times.

DSN=DataSourceName DataSourceName is the DSN that you are using for the connection. You can set additional configuration options by appending key-value pairs to the connection string.

Configuration options that are passed in using a connection string take precedence over configuration options that are set in the DSN. Example Connection Strings without DSN Some applications provide support for connecting to a data source using a driver without a DSN. To connect to a data source without using a DSN, use a connection string instead. The placeholders in the examples are defined as follows, in alphabetical order:. ClusterName is the name of the ZooKeeper cluster to which you are connecting. DomainName is the fully qualified domain name of the Drill server host.

PortNumber is the number of the TCP port that the Drill server uses to listen for client connections. Server is the IP address or host name of the Drill server to which you are connecting. ServiceName is the Kerberos service principal name of the Drill server. YourPassword is the password corresponding to your user name.

YourUserName is the user name that you use to access the Drill server. Drillbit Connections The following is the format of a DSN-less connection string for a Drillbit that does not require authentication. Driver=MapR Drill ODBC Driver;ConnectionType=Direct; Host=192.168.227.169;Port=31010; AuthenticationType=Plain; UID=username;PWD=mapr999 Testing the ODBC Connection The procedure for testing the ODBC connection differs depending on your platform, as described in the following sections:. Testing the ODBC Connection on Linux To test the ODBC connection on Linux use the test utilities in the samples directory of the driver manager installation: iodbctest and iodbctestw. Use iodbctest to test how your driver works with an ANSI application. Use iodbctestw to test how your driver works with a Unicode application. There are 32-bit and 64-bit installations of the iODBC driver manager available.

If you have only one or the other installed, then the appropriate version of iodbctest (or iodbctestw) is available. However, if you have both 32- and 64-bit versions installed, then you need to be careful that you are running the version from the correct installation directory.

Any Success Compiling Ruby-odbc For Mac Os

See for further details on using the iODBC driver manager. Example of a Test on Linux To test the ODBC connection on a Linux cluster, follow these steps:. For example, to start Drill in local mode on a Linux cluster. DSN=MapR Drill 64-bit 64; ConnectionType=ZooKeeper; ZKQuorum=centos23.lab:5181; ZKClusterID=docs60cluster-drillbits Testing the ODBC Connection on Mac OS X To test the ODBC connection on Mac OS X:. Start the iODBC Data Source Administrator app in /Applications. The iODBC Data Source Administrator dialog appears. On the ODBC DSN tab, select MapR Drill.

Any Success Compiling Ruby-odbc For Mac Os

Click Test. The MapR Drill login dialog appears. If you configured Plain (or Basic Authentication) in the.odbc.ini file, enter the user name and password you also configured.

Otherwise, click OK. The success message displays. Testing the ODBC Connection on Windows To test the ODBC connection on Windows, follow these steps:. Follow instructions to configure the ODBC connection on Windows. The MapR Drill ODBC Driver DSN Setup dialog is displayed.

Click Test. A Test Results popup will display that states you have successfully connected to the data source.