Skip to main content

How can I setup Vim for rails development on Ubuntu?!

General • Asked by Muhammad

Hey guys, Lately I have been trying to switch to Vim but I couldn't because It's kinda complicated. Most of the dotfiles I found were built to setup on a Mac so I'm curious if anyone here is workin with Vim on Ubuntu?!


I'm using github.com/carlhuda/janus which works on anything. It's close enough with shortcuts to Sublime Text that it was a pretty easy switch.

Just remember, with Vim all you need to learn at the beginning are enough basics to get you going. Then you can take time to learn more complicated things.


Thanks @chris, This helps a lot, one more thing though!
I'm sufring with oh my zsh with a weird error, when I run any rails command I get this error:

_rails_command:10: command not found: rails

wait it gets better, When I write exec bash and get back to exec zsh it works perfectly

I don't understand why is that!!


I'd guess that p[robably is coming from this command (line 10) https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/rails/rails.plugin.zsh#L1

I'm not quite sure why it isn't finding the rails command though. Maybe the Rails command isn't in your PATH in ZSH and when you load bash it updates your PATH?

Have you added rbenv's stuff into your .zshrc? That's probably it if I had to guess.


You're absolutely right!

This is how my zshrc file looks like now:

# If you come from bash you might have to change your $PATH.
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"

Thanks a lot Chris for your time!


You're welcome!

Btw, you can remove the duplicates of those lines and that should work fine if you want.

export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
eval "$(rbenv init -)"

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 22,346+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.