nonsequitur / inf-ruby

218 stars 69 forks source link

inf-ruby-console-auto not work #70

Closed stardiviner closed 9 years ago

stardiviner commented 9 years ago

I get nothing output in buffer *rails*. (the inf-ruby-console-auto) after executed inf-ruby-console-auto in a Rails file.

I have output in inf-ruby buffer => "robe on". And I can execute code in inf-ruby. puts "hi". And I also tested on a new Rails app code demo (generated with rails new demo).

Emacs version: 25.0.50.2 System: Arch Linux latest version inf-ruby which instaled with el-get.

dgutov commented 9 years ago

There's no output in *rails*, or there's no such buffer at all?

stardiviner commented 9 years ago

Yes, no output in buffer *rails*. I don't know how to debug this more.

dgutov commented 9 years ago

Not even the Ruby prompt?

stardiviner commented 9 years ago

Yes, not even the Ruby prompt.... nothing at all.

dgutov commented 9 years ago

Do you see the same result if you call (run-ruby "rails console") instead? Or (run-ruby "bundle exec rails console").

If so, please upload that project, with Gemfile.lock and everything, somewhere I can look at it. Or if it's proprietary, reproduce the problem in a new project first.

dgutov commented 9 years ago

Also, what's your version of Ruby?

stardiviner commented 9 years ago
  1. I tested on a new project (just generated with $ rails new test-app), still failed.
  2. I use RVM.
    • rvm version: rvm 1.26.10
    • ruby version (in rvm): ruby 2.2.0dev
    • bundle version: 1.8.2
  3. the result of call (run-ruby "rails console") and (run-ruby "bundle exec rails console") Emacs open the inf-ruby inferior buffer, but did not show anything different, and I test whether Rails is loaded with Rails.env, but it report error: uninitialized constant Rails.
  4. I uploaed my new generated test Rails app on this repo: https://github.com/stardiviner/test-app
dgutov commented 9 years ago

Works okay here, with a similar configuration (tried Bundler 1.8.0 and 1.8.3):

Loading development environment (Rails 4.2.0)
irb(main):001:0> Dir.pwd
=> "/home/gutov/vc/test-app"
irb(main):004:0> RUBY_VERSION
=> "2.2.0"
irb(main):013:0> Bundler::VERSION
=> "1.8.3"
irb(main):024:0> RUBY_PATCHLEVEL
=> 0
irb(main):028:0> RUBY_RELEASE_DATE
=> "2014-12-25"
irb(main):033:0> RUBY_REVISION
=> 49005
irb(main):045:0> Rails.env
=> "development"

Maybe you need to recompile Ruby with Readline support and/or upgrade to the release version. That 2.2.0dev version doesn't look right to me.

Anyway, I use rbenv. Were I you, I'd also double-check that Emacs uses the right version of Ruby.

stardiviner commented 9 years ago

Fixed, after switch to rbenv. And have another issue now: The first time I open inf-ruby-console-auto in Rails still does not show anything, then I kill the buffer (process), and re-open it again, it successed then.

dgutov commented 9 years ago

I'm afraid you'll still have to investigate it yourself. I see no such behavior.

dgutov commented 9 years ago

User error: https://github.com/dgutov/robe/issues/32#issuecomment-143161343