nonsequitur / inf-ruby

219 stars 68 forks source link

A very simple project, Works with ruby 2.6.3, Not works with ruby 2.7.1 ? #134

Closed zw963 closed 4 years ago

zw963 commented 4 years ago

I test it on a very simple project.

[DEPRECATED] bundle console will be replaced by bin/console generated by bundle gem <name> irb: warn: can't alias context from irb_context. ▽--- ERROR REPORT TEMPLATE -------------------------------------------------------

Error Report

Questions

Please fill out answers to these questions, it'll help us figure out why things are going wrong.

Backtrace

Following is the backtrace when i press C-g on emacs.

NoMethodError: undefined method `pre_match' for nil:NilClass
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/reline/ansi.rb:112:in `block in cursor_pos'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/reline/ansi.rb:105:in `raw'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/reline/ansi.rb:105:in `cursor_pos'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/reline.rb:345:in `may_req_ambiguous_char_width'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/reline.rb:207:in `inner_readline'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/reline.rb:174:in `readmultiline'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/forwardable.rb:235:in `readmultiline'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/forwardable.rb:235:in `readmultiline'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb/input-method.rb:262:in `gets'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb.rb:518:in `block (2 levels) in eval_input'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb.rb:695:in `signal_status'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb.rb:517:in `block in eval_input'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb/ruby-lex.rb:166:in `lex'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb/ruby-lex.rb:138:in `block (2 levels) in each_top_level_statement'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb/ruby-lex.rb:135:in `loop'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb/ruby-lex.rb:135:in `block in each_top_level_statement'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb/ruby-lex.rb:134:in `catch'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb/ruby-lex.rb:134:in `each_top_level_statement'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb.rb:536:in `eval_input'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb.rb:471:in `block in run'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb.rb:470:in `catch'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb.rb:470:in `run'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/irb.rb:399:in `start'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli/console.rb:19:in `run'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:506:in `console'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
  /home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
  /home/zw963/.rvm/rubies/ruby-2.7.1/bin/bundle:23:in `load'
  /home/zw963/.rvm/rubies/ruby-2.7.1/bin/bundle:23:in `<main>'
  /home/zw963/.rvm/gems/ruby-2.7.1@rspec_example/bin/ruby_executable_hooks:24:in `eval'
  /home/zw963/.rvm/gems/ruby-2.7.1@rspec_example/bin/ruby_executable_hooks:24:in `<main>'

Environment

Bundler       2.1.4
  Platforms   ruby, x86_64-linux
Ruby          2.7.1p83 (2020-03-31 revision a0c7c23c9cec0d0ffcba012279cd652d28ad5bf3) [x86_64-linux]
  Full Path   /home/zw963/others/.rvm/rubies/ruby-2.7.1/bin/ruby
  Config Dir  /home/zw963/.rvm/rubies/ruby-2.7.1/etc
RubyGems      3.1.2
  Gem Home    /home/zw963/others/.rvm/gems/ruby-2.7.1@rspec_example
  Gem Path    /home/zw963/others/.rvm/gems/ruby-2.7.1@rspec_example:/home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0
  User Home   /home/zw963
  User Path   /home/zw963/.gem/ruby/2.7.0
  Bin Dir     /home/zw963/others/.rvm/gems/ruby-2.7.1@rspec_example/bin
Tools         
  Git         2.28.0
  RVM         1.29.10 (latest)
  rbenv       not installed
  chruby      not installed

Bundler Build Metadata

Built At          2020-01-05
Git SHA           32a4159325
Released Version  true

Bundler settings

# bundle_build.pg
  You have not configured a value for `# bundle_build.pg`
git.allow_insecure
  Set for the current user (/home/zw963/.bundle/config): "true"
source
  Set for the current user (/home/zw963/.bundle/config): "https://gems.ruby-china.org"
only_update_to_newer_versions
  Set for the current user (/home/zw963/.bundle/config): true
disable_multisource
  Set for the current user (/home/zw963/.bundle/config): true
# bundle_specific_platform
  You have not configured a value for `# bundle_specific_platform`
# bundle_global_gem_cache
  You have not configured a value for `# bundle_global_gem_cache`
default_install_use_path
  Set for the current user (/home/zw963/.bundle/config): "true"
# bundle_build.nokogiri
  You have not configured a value for `# bundle_build.nokogiri`
retry
  Set for the current user (/home/zw963/.bundle/config): 2
job
  Set for the current user (/home/zw963/.bundle/config): "4"
bin_path
  Set via BUNDLE_BIN_PATH: "/home/zw963/others/.rvm/rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle"
gemfile
  Set via BUNDLE_GEMFILE: "/home/zw963/others/Project/rspec_example/Gemfile"

Gemfile

Gemfile

# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem 'vcr'
gem 'rspec'

# gem "rails"

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    diff-lcs (1.4.4)
    rspec (3.9.0)
      rspec-core (~> 3.9.0)
      rspec-expectations (~> 3.9.0)
      rspec-mocks (~> 3.9.0)
    rspec-core (3.9.2)
      rspec-support (~> 3.9.3)
    rspec-expectations (3.9.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.9.0)
    rspec-mocks (3.9.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.9.0)
    rspec-support (3.9.3)
    vcr (6.0.0)

PLATFORMS
  ruby

DEPENDENCIES
  rspec
  vcr

BUNDLED WITH
   2.1.4

--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

First, try this link to see if there are any existing issue reports for this error: https://github.com/bundler/bundler/search?q=undefined+method+%60pre_match%27+for+nil+NilClass&type=Issues

If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at: https://github.com/bundler/bundler/issues/new

Process bundle console exited abnormally with code 1

dgutov commented 4 years ago

Hi!

If your Ruby version compiled with Readline support?

dgutov commented 4 years ago

[DEPRECATED] bundle console will be replaced by bin/console generated by bundle gem

How about that bin/console file, BTW? Does it exist? Can you edit it to enable nomultiline mode, as mentioned here: https://github.com/ruby/irb/issues/43#issuecomment-589593889

?

zw963 commented 4 years ago

How about that bin/console file, BTW? Does it exist?

Not exists, it just a little test project for test Robe which created manually.

Can you edit it to enable nomultiline mode, as mentioned here: ruby/irb#43 (comment)

Yes, i test it, it works as expected after add following config into ~/.irbrc, thank you.

# We need set following enviroment variable in emacs with:
# (setenv "LOAD_FROM_EMACS" "t")

if ENV['LOAD_FROM_EMACS']
  IRB.conf[:USE_MULTILINE] = false
end
zw963 commented 4 years ago

I saw several issue was created subject to this multi-line issue, i create a PR #135 for clarify this, do you consider merge?

zw963 commented 4 years ago

We can continue discuss there.

https://github.com/nonsequitur/inf-ruby/pull/135#issuecomment-676242155