Error loading rails environment #52

Closed
barthezslavik opened this Issue Sep 18, 2011 · 5 comments

Comments

Projects
None yet
5 participants

Ubuntu 11.04, Rails 3.1.0.rc6, Vim 7.3 (2010 Aug 15, compiled Mar 24 2011 07:07:34)

Owner

tpope commented Sep 19, 2011

What does this even mean?

This is happens when I press Ctrl-X Ctrl+O first time

@barthezslavik barthezslavik reopened this Sep 19, 2011

@ghost ghost assigned segfault Sep 19, 2011

Owner

dkearns commented Apr 26, 2012

Please reopen this issue, with a meaningful description of the problem, if it still exists.

@dkearns dkearns closed this Apr 26, 2012

mad-raz commented Mar 26, 2015

I have the following configurations in my vimrc

autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1

and I'm also using the YouCompleteMe vim plugin... when I type something like the following

Rails.logger. (YouCompleteMe auto completion)

in the previous case I get error loading rails environment

here is the logs also

Executing TextChangedI Auto commands for "*"
autocommand call s:Highlight_Matching_Pair()

Searching for "autoload/rubycomplete.vim" in "/Users/abdelrazzak/.vim,/Users/abdelrazzak/.vim/bundle/bufexplorer,/Users/abdelrazzak/.vim/bundle/ctrlp,/Users/abdelrazzak/.vim/bundle/editorconfig-vim,/Users/abdelrazzak/.vim/bundle/MatchTagAlways,/Users/abdelrazzak/.vim/bundle/nerdcommenter,/Users/abdelrazzak/.vim/bundle/nerdtree,/Users/abdelrazzak/.vim/bundle/tabular,/Users/abdelrazzak/.vim/bundle/ultisnips,/Users/abdelrazzak/.vim/bundle/vim-airline,/Users/abdelrazzak/.vim/bundle/vim-coffee-script,/Users/abdelrazzak/.vim/bundle/vim-fugitive,/Users/abdelrazzak/.vim/bundle/vim-gitgutter,/Users/abdelrazzak/.vim/bundle/vim-haml,/Users/abdelrazzak/.vim/bundle/vim-jsbeautify,/Users/abdelrazzak/.vim/bundle/vim-rails,/Users/abdelrazzak/.vim/bundle/vim-rbenv,/Users/abdelrazzak/.vim/bundle/vim-ruby,/Users/abdelrazzak/.vim/bundle/vim-snippets,/Users/abdelrazzak/.vim/bundle/YouCompleteMe,/usr/local/share/vim/vimfiles,/usr/local/share/vim/vim74,/usr/local/share/vim/vimfiles/after,/Users/abdelrazzak/.vim/bundle/vim-coffee-sc
Searching for "/Users/abdelrazzak/.vim/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/bufexplorer/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/ctrlp/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/editorconfig-vim/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/MatchTagAlways/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/nerdcommenter/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/nerdtree/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/tabular/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/ultisnips/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-airline/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-coffee-script/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-fugitive/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-gitgutter/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-haml/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-jsbeautify/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-rails/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-rbenv/autoload/rubycomplete.vim"
Searching for "/Users/abdelrazzak/.vim/bundle/vim-ruby/autoload/rubycomplete.vim"
chdir(/Users/abdelrazzak/.vim/bundle/vim-ruby/autoload)
fchdir() to previous dir
line 1: sourcing "/Users/abdelrazzak/.vim/bundle/vim-ruby/autoload/rubycomplete.vim"
finished sourcing /Users/abdelrazzak/.vim/bundle/vim-ruby/autoload/rubycomplete.vim
continuing in function youcompleteme#Complete..<SNR>103_GetCompletions
chdir(app/models)
fchdir() to previous dir
Error loading rails environment-- INSERT --
Executing CursorMovedI Auto commands for "*"
autocommand call UltiSnips#CursorMoved()

the latest configuration of my vim is found here

mad-raz commented Mar 27, 2015

after a little bit investigation... I found that this line fails https://github.com/vim-ruby/vim-ruby/blob/master/autoload/rubycomplete.vim#L468
I don't know how to debug this more than that...
and if you are wondering here is my environment.rb file in a standard rails 4.2 app

# Load the Rails application.
require File.expand_path('../application', __FILE__)

# Initialize the Rails application.
Rails.application.initialize!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment