Rsense: Intelligent Code Completion for Ruby


#1

http://rsense.github.io/

The first plugin I’ve released is the Atom plugin: https://github.com/rsense/atom-rsense / https://atom.io/packages/rsense . Other editors will follow, but atom will likely continue to be the first to get new features.


#2

This is very cool! I hope it comes for PHP as well soon (or by other package creators).


#3

I have some issue making it working, I get a following version error in /tmp/rsense.log :

Bundler::RubyVersionMismatch: Your Ruby version is 1.9.3, but your Gemfile specified 2.1.1
           validate_ruby! at /Users/cedric/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.6.4/lib/bundler/definition.rb:390
           setup at /Users/cedric/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.6.4/lib/bundler.rb:116
          (root) at /Users/cedric/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.6.4/lib/bundler/setup.rb:17
         require at org/jruby/RubyKernel.java:1065
          (root) at file:/Users/cedric/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/jruby-jars-1.7.13/lib/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1

Given that I’m using rbenv on a 2.1.1 project, that I tried starting rsense using both bundle exec rsense start --port 47367 from a terminal, or by setting bundle exec rsense in the corresponding atom-rsense setting and that bundle install obviously worked without issue.

I’m a bit at loss here, is there any version restriction to use rsense? I couldn’t find mention of versions support in either the source and the sample project.


#4

So, the Ruby Version of 1.9.3 comes from the copy of jruby rsense uses internally to talk to java (original rsense was written in java). . I have never seen this error before. Is that ruby version specified in the Gemfile instead of in .ruby-version file?

A workaround to try is to run rsense without bundler, and pass it the project path: rsense start --project /User/path/to/project . The project path is the root directory of your project. Thanks.


#5

To answer your question: no there are no known version restrictions (It might not run on old 1.8 versions, have not tested it since they are no longer supported). But I have run it on 1.9.3, 2.0, and 2.1.2.


#6

Yep exactly, as we deploy our projects on heroku that require to set the ruby version in the gemfile. Thanks for the explanations, I’ll try that.


#7

Ok, after having tried your solution using the --path option as well as having tried removing the ruby version from the Gemfile I still can’t have rsense working properly

~/Development/ruby/my-project ⮀ ⭠ master ● ⮀ be rsense start --port 47367 --path /Users/cedric/Development/ruby/my-project
rsense version: 0.5.16
logs at: /tmp/rsense.log
process running at: 10793
 ~/Development/ruby/my-project ⮀ ⭠ master ● ⮀ curl http://localhost:47367
curl: (7) Failed connect to localhost:47367; Connection refused
 ✘ ~/Development/ruby/my-project ⮀ ⭠ master ● ⮀ cat /tmp/rsense.log
 ~/Development/ruby/my-project ⮀ ⭠ master ● ⮀

It seems like there just no server running and there’s just no infos in the log.


#8

A bit of follow up.

I was able to make the sample project works in pretty much every version of ruby, but I can’t make it works with any of my rails project, from 1.9.3 to 2.1.2. The lack of meaningful error messages is quite annoying as I can’t provide any debug information.
Maybe, if someone was able to make it work with rbenv and rails projects, he can share his experience, but as things goes I’ll have to disable this extension as it constantly make failing requests to an nonexistent server.


#9

Is this no longer under active development? Last commit was 4 months ago.


#10

I could really use some help with it @chrisb , there are a lot of changes that need to be made to bring it current with recent changes in Autocomplete Plus . Changes I have not had time to make. Feel free to hit me up in an issue on it’s github page if you’d like to help out.


#11

Cool. Wasn’t sure. I will check it out further and see what I can do to help. Thanks for the response!