Jedi-vim: No auto-complete on dot (.), testing shows erroneous "no python" error - jedi-vim

I just installed jedi-vim and supertab (because I already had something bound to <C-Space>). <Tab> now shows the autocomplete menu and it's working pretty well, however I don't see any menus when I hit ..
If I use <Tab> in insert mode after pressing ., I get the normal menu that doesn't have the context of the name preceding the dot (and it's not at all useful because of it).
:verbose imap . says No mapping found, but I'm guessing that's not how jedi-vim works.
In my effort to troubleshoot the issue I've disabled my other plugins and replaced my .vimrc with just execute pathogen#infect().
Now, when I :e foo.py I see: "Error: jedi-vim failed to initialize Python: jedi-vim requires Vim with support for Python 2 or 3." I didn't get this error before, and :version shows that I have both Python 2 and 3 support.
Scriptnames: https://gist.github.com/hovissimo/a2413d6a5d0e1be356c0
:version: https://gist.github.com/hovissimo/f5a0e630edac8756397e
Edit:
:JediDebugInfo says Using Python Version: null

I don't know why I didn't see the error before, but it looks like my python3 integration in Vim was in fact broken.
I had Python 3.5 32-bit installed, but I was using a 64-bit version of Vim. Installing a 32-bit version of Vim (making sure it was compiled for python35) seems to have fixed all problems.

Related

Cannot install RuboCop on RubyMine

I'm opening ruby file via RubyMine. IDE suggests installing RuboCop. I accept it, but after a few seconds it shows:
Following gems were not installed: rubocop (1.0.0): Cancelled
Documentation says its problem with interpreter path. Problem is its already set. Even when i try to add it like documentation says, it won't let me, because its already set.
Any ideas what i can do? I have been using VisualStudio Code without issues before it, but Ruby support is pretty poor, i had to use terminal, while for example python has full support and you can just run program with one button.

rbenv and sublime text 3

I have installed ruby using rbenv. I am using sublime text 3 and a Linux Mint 17.1 system. I am trying to build a program using control-b. When I do this I get the following message:
/bin/bash: ruby: command not found
[Finished in 0.0s with exit code 127]
[shell_cmd: ruby "/home/christopher/projects/hello.rb"]
[dir: /home/christopher/projects]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr /games:/usr/local/games]
When I check my path using my terminal, I get the following:
/home/christopher/.rbenv/shims:/home/christopher/.rbenv/bin:/usr/local /sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
How do I get my paths to line up?
Looking a long time for a solution to this I found the script "Pathway" that gave me an idea how to fix this.
I ended adding the following Pathway.py file to ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User to set a fixed ruby version managed by rbenv for all my sublime sessions:
import os
import subprocess
HOME = '/Users/my_user' # <== Change this accordingly
RBENV = '/.rbenv/versions/2.5/bin' # <== Choose version from ~/.rbenv/versions
# Sublime's default path is
# /usr/bin:/bin:/usr/sbin:/sbin
os.environ['PATH'] = HOME + RBENV + ':' + os.environ['PATH']
print('[Pathway] now the PATH is = ' + os.environ['PATH'])
print('[Pathway] sublime now uses', subprocess.check_output(["which", "ruby"]))
Now I have a deterministic and controllable ruby version to run things in sublime 🙂
So for "rbenv", your ruby executable is probably at "~/.rbenv/shims/ruby". But check! (On linux, in the directory you'll be working in, at the prompt, type "which ruby".)
The default Ruby SublimeText 3 Build system may not point to the right place.
At least that's what I think the problem was for me.
Issue is, while you can (maybe should) define a new build system for Ruby, for me, that meant two Ruby build systems, as I could not figure out what to do with the old built in one.
You can change the old one easily by installing package "PackageResourceViewer" and then restarting sublime, and then command (shift-ctrl-p on linux) "PackageResourceViewer:OpenResource" and search for "Ruby", then look for the Build system. Note I commented out stuff, and left good notes in case I need to revert.
I presume that when I next install ST3, this will be overwritten. Adding a new build system, or working with path or something is probably a better approach, but I already took to much time on this.
References
Building Ruby and Using RVM
SublimeText 3 Ruby Build Error

IntelliJ PHP Interpreter not finding homebrew installed PHP in Mac OS X

IntelliJ will not detect installed PHP even though it does exist and can be used from the command line. I have installed php via brew install php54. Below is a screenshot of my issue along with evidence that it does exist. I've tried clicking the refresh button many times, but it will not pick up the binary.
I just had the same problem. Through some hackery, I discovered it was due to some ansi escape sequences in my prompt. From your screenshot it looks like you might have the same or a similar issue.
Essentially, IntelliJ uses a php script to create an XML string out of some PHP configuration items, including $_SERVER. The $_SERVER superglobal contains environment variables and therefore picked up the escape character (0x1b) in the sequence. Since the escape character is invalid in XML, IntelliJ rejected the output and concluded the PHP interpreter was bad.
Once I removed the ansi sequences from my prompt, IntelliJ recognized the PHP interpreter right away.
Hope this helps.
I had the same issue, and it turned out my Homebrew install was severely out of date when I installed PHP. To fix it, I ran:
brew update && brew upgrade
With some quick help from jetbrains support, the latest EAP version fixed it for me: http://confluence.jetbrains.com/display/IDEADEV/IDEA+14+EAP
http://youtrack.jetbrains.com/issue/WI-23045
If you prefer to keep investigating the issue, see Chris' answer and search the idea.log for something like:
INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/php.xml file is null
idea.log locations
I've just now come back to this after some time and it looks like the latest version IntelliJ works with PHP installed via Homebrew. So I'm going to mark this as resolved.

Textmate error duplicating lines "ruby: warning: -K is specified; it is for 1.8 compatibility and may cause odd behavior"

While using ctrl+shift+d to shortcut to duplicate lines in Textmate, I came to the following error:
"ruby: warning: -K is specified; it is for 1.8 compatibility and may cause odd behavior"
This problem isn't limited to duplicating lines, but shows up in may other places where ruby is used. I solved it by changing PATH at Preferences… > Advanced > Shell Variables to /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
After this change, TextMate will use the older version of ruby which doesn't output said warnings.
This is an output warning from ruby 2.0 .
The only way I could solve it was by going to
/System/Library/Frameworks/Ruby.framework/Versions and changing the symlink named Current to point to the folder 1.8 ( /System/Library/Frameworks/Ruby.framework/Versions/1.8 ) .
In other words, changed back to use ruby 1.8 instead of 2.0 .

Use default ruby version in Sublime Text 2

My default and current version of ruby is 1.9.3. It's actually the only version that appears when I run rvm list so I don't see how I can be messing that part up. I did follow this
tutorial that I found here, but it just seemed to break everything. I keep getting "No such file or directory" for all the variations of the fix I see, even the in the comments. I am on a Mac, please let me know what other information I need to post here to help you figure out how I'm breaking things.
You can always edit which ruby is used by editing your Build command preferences:
subl ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Ruby/Ruby.sublime-build
Change the default "ruby" to whatever path you require. The version you're using at any given time can be discovered with:
which ruby
Alternatively you can just link to the default which is often located at /opt/local/rvm/bin/ruby.

Resources