Ask A Question

Notifications

You’re not receiving notifications from this thread.

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

Muhammad asked in General

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?!

Reply

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.

Reply

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!!

Reply

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.

Reply

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!

Reply

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 -)"
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,796+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.