MacVim and rails.vim not working


#1

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
[removed_email_address@domain.invalid] ~/.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?


#2

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


#3

Harold wrote:

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

Stupid maintainer.

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

shell returned 127

But this works now:

:Rcontroller products


#4

On Thu, Apr 30, 2009 at 6:10 PM, 7stud –
removed_email_address@domain.invalidwrote:

Harold wrote:

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

Stupid maintainer.

Excuse me?

–autoload
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


#5

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?


#6

Harold A. Giménez Ch. wrote:

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.

On Thu, Apr 30, 2009 at 6:34 PM, 7stud –

Excuse me?

whoops.

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

I installed rails as a gem. Here is the output:

$ rails -v
Rails 2.3.2
$ which rails
/usr/local/bin/rails

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

Yep. And I don’t really care if I am unable to create rails apps in
macvim. I can do that from the command line.

Thanks for your help.


#7

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.

On Thu, Apr 30, 2009 at 6:34 PM, 7stud –


#8

cd ~
ls -R .vim/

.vim/:
autoload doc history plugin

.vim/autoload:
dbext_dbi.vim dbext.vim rails.vim

.vim/doc:
dbext_gpl.dat project.txt surround.txt tags
dbext.txt rails.txt taglist.txt

.vim/history:
dbext_sql_history.txt

.vim/plugin:
dbext.vim matrix.vim multvals.vim rails.vim
surround.vim
genutils.vim minibufexpl.vim project.vim supertab.vim taglist.vim


Please confirm the command.
Such as rails , and so on.


#9

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

PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE
VSIZE
1200 top 6.9% 0:06.71 1 18 20 544K 428K 1.01M
27.0M
1195 bash 0.0% 0:00.01 1 14 16 220K 824K 804K
27.1M
1194 login 0.0% 0:00.00 1 16 40 172K 508K 660K
26.9M
1192 Terminal 1.0% 0:02.26 4 90 142 1.99M 10.7M+ 8.01M+
231M+
1167 ruby 0.1% 0:04.17 2 10 132 20.3M 2.59M 21.7M
50.4M
1141 lookupd 0.0% 0:00.19 2 34 38 464K 1.02M 1.26M
28.5M
1138 MDCPdUSB 0.0% 0:00.01 1 23 20 312K 772K 996K
27.1M
1136 pppd 0.0% 0:00.04 1 26 30 332K 1.02M 1.43M
27.4M
1130 mdimport 0.0% 0:00.33 4 65 56 1.23M 3.67M 4.08M
39.7M
357 Preview 0.0% 0:00.36 1 69 118 1.73M 7.95M 6.29M
225M
217 AppleSpell 0.0% 0:01.45 1 44 34 700K 3.18M 2.37M
37.8M
214 Safari 0.0% 29:11.21 9 298 3311 407M 52.6M 323M
700M
207 automount 0.0% 0:00.01 3 39 30 308K 924K 1.09M
28.7M
203 automount 0.0% 0:00.01 3 41 34 316K 956K 1.13M
29.0M
200 rpc.lockd 0.0% 0:00.00 1 10 17 124K 452K 220K
26.7M
191 nfsiod 0.0% 0:00.00 5 30 24 124K 352K 208K
28.6M


That ruby process looks suspicious. I don’t know what that is.