Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:Rails console non-absolute home (ArgumentError) #571

Open
ConanChou opened this issue Dec 22, 2020 · 4 comments
Open

:Rails console non-absolute home (ArgumentError) #571

ConanChou opened this issue Dec 22, 2020 · 4 comments

Comments

@ConanChou
Copy link

Hi, I was trying out vim-rails on a rails app with version 6.1. :Rails server works fine, but :Rails console will error out.

The rails app is almost fresh generated. I only added 2 models. So no crazy customization yet.

Here is the traceback:

`$HOME` is not a directory.
Bundler will use `/var/folders/4w/r5r6dd3n4wq8q7qwfj3jw8c80000gn/T/bundler20201221-58977-jwlbfb58977' as your home directory temporarily.
Running via Spring preloader in process 58978
Loading development environment (Rails 6.1.0)
2.7.0 :001 > Traceback (most recent call last):
	53: from -e:1:in `<main>'
	52: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	51: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	50: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
	49: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
	48: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
	47: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
	46: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:180:in `serve'
	45: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/activesupport-6.1.0/lib/active_support/fork_tracker.rb:26:in `fork'
	44: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/activesupport-6.1.0/lib/active_support/fork_tracker.rb:8:in `fork'
	43: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/activesupport-6.1.0/lib/active_support/fork_tracker.rb:8:in `fork'
	42: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/activesupport-6.1.0/lib/active_support/fork_tracker.rb:10:in `block in fork'
	41: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:220:in `block in serve'
	40: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/command_wrapper.rb:38:in `call'
	39: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/commands/rails.rb:6:in `call'
	38: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
	37: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
	36: from /Users/conan/work/myapp/bin/rails:5:in `<main>'
	35: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
	34: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
	33: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
	32: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	31: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
	30: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
	29: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/commands.rb:18:in `<main>'
	28: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/command.rb:50:in `invoke'
	27: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/command/base.rb:69:in `perform'
	26: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
	25: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
	24: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
	23: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/commands/console/console_command.rb:102:in `perform'
	22: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/commands/console/console_command.rb:19:in `start'
	21: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/commands/console/console_command.rb:70:in `start'
	20: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:398:in `start'
	19: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:469:in `run'
	18: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:469:in `catch'
	17: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:470:in `block in run'
	16: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:535:in `eval_input'
	15: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:134:in `each_top_level_statement'
	14: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:134:in `catch'
	13: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:135:in `block in each_top_level_statement'
	12: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:135:in `loop'
	11: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:138:in `block (2 levels) in each_top_level_statement'
	10: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:166:in `lex'
	 9: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:516:in `block in eval_input'
	 8: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:693:in `signal_status'
	 7: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:517:in `block (2 levels) in eval_input'
	 6: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/input-method.rb:258:in `gets'
	 5: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/forwardable.rb:235:in `readmultiline'
	 4: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/forwardable.rb:235:in `readmultiline'
	 3: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/reline.rb:170:in `readmultiline'
	 2: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/reline.rb:224:in `inner_readline'
	 1: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/reline/config.rb:87:in `read'
/Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/reline/config.rb:87:in `expand_path': non-absolute home (ArgumentError)
	41: from -e:1:in `<main>'
	40: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	39: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	38: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
	37: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
	36: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
	35: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
	34: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:180:in `serve'
	33: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/activesupport-6.1.0/lib/active_support/fork_tracker.rb:26:in `fork'
	32: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/activesupport-6.1.0/lib/active_support/fork_tracker.rb:8:in `fork'
	31: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/activesupport-6.1.0/lib/active_support/fork_tracker.rb:8:in `fork'
	30: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/activesupport-6.1.0/lib/active_support/fork_tracker.rb:10:in `block in fork'
	29: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/application.rb:220:in `block in serve'
	28: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/command_wrapper.rb:38:in `call'
	27: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/spring-2.1.1/lib/spring/commands/rails.rb:6:in `call'
	26: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
	25: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
	24: from /Users/conan/work/myapp/bin/rails:5:in `<main>'
	23: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
	22: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
	21: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
	20: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	19: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
	18: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
	17: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/commands.rb:18:in `<main>'
	16: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/command.rb:50:in `invoke'
	15: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/command/base.rb:69:in `perform'
	14: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
	13: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
	12: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
	11: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/commands/console/console_command.rb:102:in `perform'
	10: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/commands/console/console_command.rb:19:in `start'
	 9: from /Users/conan/.rvm/gems/ruby-2.7.0/gems/railties-6.1.0/lib/rails/commands/console/console_command.rb:70:in `start'
	 8: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:398:in `start'
	 7: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:473:in `run'
	 6: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:473:in `ensure in run'
	 5: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:473:in `each'
	 4: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb.rb:473:in `block in run'
	 3: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ext/save-history.rb:62:in `block in extended'
	 2: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ext/save-history.rb:110:in `save_history'
	 1: from /Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ext/save-history.rb:110:in `open'
/Users/conan/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/irb/ext/save-history.rb:110:in `initialize': No such file or directory @ rb_sysopen - /Users/conan/work/myapp/$HOME/.irb-history (Errno::ENOENT)
--- Press ENTER to continue ---

Any idea why? Thanks

@tpope
Copy link
Owner

tpope commented Dec 22, 2020

Obvious question is "what is :echo $HOME?"

@ConanChou
Copy link
Author

ConanChou commented Dec 22, 2020

It's /Users/conan.

Sorry, I forgot to mention that I'm using the plugin in Neovim 0.4.4 under iTerms2 3.4.3, with macOS Catalina 10.15.7.

@tpope
Copy link
Owner

tpope commented Dec 22, 2020

Are you using dispatch.vim, and if so, what adapter?

The code that handles :Rails console is the same code that handles :Rails server so this is a curious failure to say the least.

vim-rails/autoload/rails.vim

Lines 1853 to 1854 in 3cc3430

if str =~# '^\%(c\|console\|db\|dbconsole\|s\|server\)\S\@!' && str !~# ' -d\| --daemon\| --help'
return rails#app().start_rails_command(str, a:bang)

@ConanChou
Copy link
Author

ConanChou commented Dec 22, 2020

Yes, I also installed dispatch.vim with default settings. It dispatches to a new iTerm tab, so I believe the adapter is iTerm.

FYI, I just tested running with tmux adapter, :Console works fine. So it's likely something related to the iTerm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants