talek / vorax4

A simple yet powerful IDE for Oracle databases, built on top of the widely known Vim editor and Oracle SqlPLUS.
http://talek.github.io/vorax4
MIT License
53 stars 11 forks source link

Problem trying to install Vorax on OSX 10.10.1 #57

Closed bartb closed 9 years ago

bartb commented 9 years ago

Hi,

First of all, Vorax looks great!! Can't wait to try it.

I followed the install documentation but I can't seem to work it out.

I have vim 7.3:

$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep  9 2014 16:30:51)
:echo has('patch501')

return 0 (zero). Don't know if that is good or not.

The Ruby version of VIM is:

:ruby puts RUBY_VERSION
output: 2.0.0

I managed to get Vorax installed (after I installed the XCode command tools):

$ gem list
....
vorax (5.3.1)

But now when I start Vim and type

:VORAXconnect

i get

E492: Not an editor command: VORAXconnect

Perhaps you know what the problem is? (I should point out that I'm very new to Vim)

talek commented 9 years ago

Hi @bartb,

The command is: VORAXConnect (capital C). On Vim 7.3, you need that patch. Unfortunately, I don't have a MAC to test this, but you may have a look here, especially under "MAC OS Notes".

talek commented 9 years ago

I've just noticed that Pavel Popov's blog post is not available anymore. He was explaining there how it made it work on his MAC.

bartb commented 9 years ago

Okay, got a bit further. I had to copy the folders (autoload, doc, ftplugin, indent, nerdtree_plugin, plugin, syntax, vorax) to ~/.vim.

Now when I do VORAXConnect usr/pwd@orcl I get the following error:

Initializing connection...
Error detected while processing function vorax#sqlplus#Connect..vorax#sqlplus#Initialize..vorax#ruby#SqlplusFork:
line   13:
ChildProcess::LaunchError: No such file or directory - sqlplus

I have sqlplus installed:

$ sqlplus
SQL*Plus: Release 11.2.0.3.0 Production on Thu Dec 11 17:29:05 2014
Copyright (c) 1982, 2012, Oracle.  All rights reserved.
Enter user-name: 
talek commented 9 years ago

Is sqlplus in your $PATH, available to your vim? Just check by launching sqlplus from vim:

!sqlplus /nolog
bartb commented 9 years ago
:!sqlplus /nolog
zsh:1: command not found: sqlplus

shell returned 127 

That is weird, because I can execute sqlplus right from the shell:

$ which sqlplus
/usr/local/instantclient/sqlplus
talek commented 9 years ago

Which means your shell sees other $PATH than your vim. You can check this by executing:

!echo $PATH

from your vim. You can also try to launch your vim from that shell.

bartb commented 9 years ago

Indeed, almost there... I just need to change the internal $PATH of MacVim somehow.

talek commented 9 years ago

Have you tried to run MacVim from your terminal? As a quick workaround, it should see the $PATH from your shell.

bartb commented 9 years ago

Added instantclient to the path of MacVim (in the file ~/.zprofile). But now this:

Initializing connection...
Error detected while processing function vorax#sqlplus#Connect..vorax#sqlplus#Initialize..vorax#ruby#SqlplusFork:
line   13:
Errno::EPIPE: Broken pipe

Any idea?

talek commented 9 years ago

No, that's odd! I have to install an OSX 10.10.1 in a virtual machine (if possible) and try to reproduce this.

bartb commented 9 years ago

I'll try to find a solution also.

In the mean time, Pavel sent me this updated URL: http://iseetheline.ru/en/vorax/

I'll see if that will help me.

bartb commented 9 years ago

It works!! Woohoo! I used Pavel's .dotfile and vorax.sh to set the environment properly:

$ cat ~/.dotfiles/sqlplus.env 
# adding sqlplus variables when they needed
export ORACLE_HOME=/usr/local/instantclient
export SQLPATH=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME
export DYLD_LIBRARY_PATH=$ORACLE_HOME
export TNS_ADMIN=/usr/local/oracle/network/admin
export NLS_LANG=AMERICAN_AMERICA.UTF8
export VERSIONER_PYTHON_PREFER_32_BIT=yes
export PATH=$SQLPATH:$PATH
$ cat bin/vorax.sh 
. $HOME/.dotfiles/sqlplus.env
export VORAX=1
/usr/local/bin/mvim

Then chmod +x bin/vorax.sh, start the vorax.sh and presto, it works. Not sure what did the trick exactly. Probably export DYLD_LIBRARY_PATH.

Many thanks for your help, Talek!

velppa commented 9 years ago

Let me explain the meaning of VORAX=1 system variable.

I use Oracle Instant Client. In order to use it, one should fill environment variables ORACLE_HOME, LD_LIBRARY_PATH and/or DYLD_LIBRARY_PATH (don't remember exactly which one). But if you set it permanently OS X will give error message every time you run something with sudo. It's a known bug, I have founded information somewhere on the internet.

So, I ended up with running MacVim with Vorax included when I need to work with Oracle - I create VORAX variable and set up all paths to Oracle Instant Client. I also have a condition in .vimrc to check if VORAX=1 then load Vorax plugin.

When I just need to use Oracle Instant Client (when some scripts needs connection to Oracle) I just do source ~/.dotfiles/sqlplus.env to fill variables to OIC.

Sorry for broken link in the blog, I'm in the process of splitting posts in Russian from English ones and haven't add link to it.

talek commented 9 years ago

Thank you Pavel for sharing all this valuable information on running Vorax on MAC. I have updated the wiki with the new link to your blog post. Great!

@bartb: Glad it's working on your MAC too. Have fun!