MacVim and rails.vim not working

Hi,

I'm having trouble getting rails.vim working. Unzipping the rails.vim download on my Desktop produced a rails folder with this structure:

rails ---autoload -----rails.vim ---doc -----rails.txt ---plugin -----rails.vim

I moved that directory to ~/.vim

$ mv /Users/me/Desktop/rails ~/.vim/rails

$ cd ~/.vim ~/.vim$ ls filetype.vim rails syntax $ cd rails [autie@cws-computer.local] ~/.vim/rails$ ls autoload doc my_note.txt plugin

Then a tutorial I read said if I start macvim and issue the command

:Rails testapp

that should create a new app. But I get this error:

E492 Not an editor command: Rails testapp

I also tried this cd'ing into the top level of an existing app and starting macvim:

/depot$ mvim

and then in macvim typing:

:Rcontroller products

and I get the same error. What am I doing wrong?

Should be simple: The "rails" folder should not be present under your .vim folder. Move the plugin, doc and autoload files individually to each of the subfolders of .vim, so that the tree looks like this:

.vim > --autoload > > > --rails.vim --doc > > > --rails.txt --plugin    >    --rails.vim

Here's my vim config, as a reference: http://github.com/hgimenez/vimfiles/tree/master

-H

Harold wrote:

Should be simple: The “rails” folder should not be present under

your .vim folder.

Stupid maintainer.

Excuse me?

Move the plugin, doc and autoload files individually

to each of the subfolders of .vim, so that the tree looks like this:

.vim

–autoload

–rails.vim

–doc

–rails.txt

–plugin

–rails.vim

I actually tried that earlier, but the tutorial I was following said to

test rails.vim out by issuing the following command:

:Rails mynewapp

and this is what I got/get:

:!rails newapp

/bin/bash: line 1: rails: command not found

Well, is rails installed (as a gem, not frozen in your app). In your terminal, can you do rails --version, or which rails ?

shell returned 127

But this works now:

:Rcontroller products

So, the rails.vim plugin is up and running…

There is also a rails-vim google group: http://groups.google.com/group/vim-on-rails

7stud -- wrote:

Harold wrote:

Should be simple: The "rails" folder should not be present under your .vim folder.

Stupid maintainer.

I have a question about that: when you unzip a file isn't there a container directory? When I untar a file, all the files end up in a master directory. So when the maintainer says to extract the zip file to ~/.vim/ isn't that incorrect?

It is misleading, I’ll give you that…but for future reference, the process you just went through will be very similar with any vim plugin.

cd ~ ls -R .vim/

New problems. How do I kill the server I started within macvim/rails.vim? I started the server like this:

:Rserver

But I'm trying to debug something in my application, and I want to use puts to output a message in the server's output window. Before installing macvim and rails.vim, I kept a Terminal window open where I started the server using:

/myapp$ruby script/server

and the server(Mongrel) would log output to the window about what it was doing. Then if I used puts in my program, the output would go to the server window, and I could examine it.

I want to set up a separate Terminal window for the sever like before, so I can examine the server's output, but I can't figure out how to kill the server I started in macvim/rails.vim. If I try to start a server in Terminal, I get an "address already in use" error:

/myap$ ruby script/server => Booting Mongrel => Rails 2.3.2 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/tcphack.rb:12:in `initialize_without_backlog': Address already in use - bind(2) (Errno::EADDRINUSE)

I tried closing every macvim and Terminal window, quitting the macvim and Terminal programs, and shutting down Firefox, then relaunching Terminal. But I when I open a Terminal window and try to start the server using:

/myapp$ ruby script/server

I get the same error message: "address already in use". Here is what the top command produces:

$ top