Giter Site home page Giter Site logo

cannot run robe-rails-refresh about robe HOT 21 CLOSED

dgutov avatar dgutov commented on July 26, 2024
cannot run robe-rails-refresh

from robe.

Comments (21)

asok avatar asok commented on July 26, 2024 1

That might be possible, in theory, but the question I'm yet to find an answer for is, how do you track which inf-ruby buffer corresponds to each ruby-mode buffer?

@dgutov can't we have a plist of project directories and inf-ruby buffer names? The projects directory would have to be taken by calling projectile-project-root so this feature would have a dependency on projectile. Although this does not resolve the case of the gem sources.

from robe.

dgutov avatar dgutov commented on July 26, 2024

When I run 'robe-rails-refresh' I get:

How did you start the inf-ruby process? Was it with inf-ruby-console-auto, like the README suggests?

Also, when I open emacs shell and type bundle exec rails console and then MyModel.new` I receive

This is not relevant, but you can (setenv "PAGER" "cat") in your init file to disable paging.

from robe.

rranelli avatar rranelli commented on July 26, 2024

Looks like it was some kind of issue with pry. I just made a complete cleanup of my ~/.rbenv/ directory and installed all gems again.

Thank you for the attention =)

from robe.

dgutov avatar dgutov commented on July 26, 2024

I don't see how it could be an issue with pry.

from robe.

stardiviner avatar stardiviner commented on July 26, 2024

I got this same issue now.

head :005 > E, [2015-02-24T09:31:34.598727 #4893] ERROR -- : Request failed: /rails_refresh/. Please file an issue.
E, [2015-02-24T09:31:34.598779 #4893] ERROR -- : uninitialized constant Robe::Sash::ActionDispatch
/home/stardiviner/.emacs.d/el-get/robe-mode/lib/robe/sash.rb:165:in `rails_refresh'
/home/stardiviner/.emacs.d/el-get/robe-mode/lib/robe/sash.rb:176:in `public_send'
/home/stardiviner/.emacs.d/el-get/robe-mode/lib/robe/sash.rb:176:in `call'
/home/stardiviner/.emacs.d/el-get/robe-mode/lib/robe/server.rb:40:in `block in start'
/home/stardiviner/.emacs.d/el-get/robe-mode/lib/robe/server.rb:28:in `loop'
/home/stardiviner/.emacs.d/el-get/robe-mode/lib/robe/server.rb:28:in `start'
/home/stardiviner/.emacs.d/el-get/robe-mode/lib/robe.rb:18:in `block in start'

from robe.

dgutov avatar dgutov commented on July 26, 2024

@stardiviner Do you use Rails? What does (inf-ruby-console-rails-p) return?

from robe.

dgutov avatar dgutov commented on July 26, 2024

...if you run it in the application root.

from robe.

stardiviner avatar stardiviner commented on July 26, 2024

I get t when run command (inf-ruby-console-rails-p) in Rails app root.
And I get nil when run command (inf-ruby-console-rails-p) not in Rails app root.

from robe.

stardiviner avatar stardiviner commented on July 26, 2024

@dgutov Do you have any update on this issue?

from robe.

dgutov avatar dgutov commented on July 26, 2024

@stardiviner No progress. How do I reproduce it?

If you create a new Rails project, do you see the problem there as well?

from robe.

stardiviner avatar stardiviner commented on July 26, 2024

@dgutov yes, see the problem in a new Rails project.
Rails version: Rails 4.2.1
Ruby version: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
Emacs version: GNU Emacs 25.0.50.1
irb version: irb 0.9.6(09/06/30)
Bunder version 1.9.8

I don't know how to let your reproduce the issue again.

from robe.

dgutov avatar dgutov commented on July 26, 2024

Works for me, with Ruby 2.2.0 and Rails 4.2.1 as well. Same Emacs and irb, Bundler 1.9.4 or 1.9.9.

You should write step-by-step how you get to the error. The exact way you create a new project (is it rails new ... followed by bundle install?), and what steps you perform after launching Emacs.

from robe.

stardiviner avatar stardiviner commented on July 26, 2024

error

I know why have this error now:
I configure inf-ruby and robe-mode like this:

(with-eval-after-load 'inf-ruby
  (unless (get-buffer-process "*ruby*")
    (run-ruby "pry" "ruby")
    ))

(with-eval-after-load 'robe
  (unless (get-buffer-process "*ruby*")
    (run-ruby "pry" "ruby"))
  (robe-start))

reproduce:

use upper config, then press [C-c C-k] in rails ruby code file to refresh rails code.

reason

because inf-ruby does not support multiple instances, user can't start inf-ruby-console-auto for general ruby code file, then start a new inf-ruby instance for Rails project.
I want to ask. Is it possible to support in inf-ruby or robe-mode?

  • let inf-ruby open process bufffer for separate projects.
  • or let robe-use always use single inf-ruby for all.

from robe.

dgutov avatar dgutov commented on July 26, 2024

I configure inf-ruby and robe-mode like this:

Well, then is was a waste of my time. Just don't do that, the amount of effort you save is negligible.

let inf-ruby open process bufffer for separate projects

That might be possible, in theory, but the question I'm yet to find an answer for is, how do you track which inf-ruby buffer corresponds to each ruby-mode buffer? We'll need to interact with them from different Ruby buffers, including ones outside of project directories (like in gem sources).

Feel free to open a new issue, here or in inf-ruby.

from robe.

stardiviner avatar stardiviner commented on July 26, 2024

This is a solution, and I think is a good idea.

from robe.

dgutov avatar dgutov commented on July 26, 2024

The projects directory would have to be taken by calling projectile-project-root

No need for projectile, it will probably be the value of default-directory in the respective inf-ruby buffer. And the file-in-directory-p check should suffice. The gem issue is more complicated.

Anyway, as long as we're using inf-ruby, the next step will be to support multiple REPLs there.

from robe.

asok avatar asok commented on July 26, 2024

the next step will be to support multiple REPLs there.

I made a PR that addresses that nonsequitur/inf-ruby#91

from robe.

dgutov avatar dgutov commented on July 26, 2024

I've pushed support for multiple projects to Robe, please take a look.

from robe.

dgutov avatar dgutov commented on July 26, 2024

@asok @stardiviner Anybody using it?

from robe.

stardiviner avatar stardiviner commented on July 26, 2024

I will take a try in recent days.

from robe.

stardiviner avatar stardiviner commented on July 26, 2024

@dgutov Sorry, I can't test for recent days,My rails new project failed on some problem.

from robe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.