Rails 3 rc 上的 Macvim 和rails.vim - 未初始化的常量 Bundler (NameError)

发布于 2024-09-12 12:17:17 字数 631 浏览 2 评论 0原文

在 Windows 上配置了 vim 和 gvim,在 OSX 上配置了 vim 和 macvim。打算学习rails 3,所以在两个操作系统上都安装了rails 3 rc。到目前为止,一切都很好。

使用 macvim 时,rails.vim 提供的每个脚本执行都会出现错误“未初始化常量 Bundler (NameError)”。尝试过 :Rserver, :Rgenerate, .... 但是,在 OSX 上,当从终端窗口启动 vim 时,rails.vim 运行得很好,并且直接从终端执行 Rails 脚本。

所以在某个地方,我的 macvim 配置似乎把事情搞砸了。但是,除非我弄错了,否则它只是使用 .vimrc 和 .gvimrc 文件中的设置。现在,.gvimrc 确实很简约,所以我不妨在这里添加它:


set guifont=Inconsolata:h17 " 字体系列和字体大小。 设置抗锯齿“ MacVim:平滑字体。 setencoding=utf-8 " 到处使用 UTF-8。 set guioptions-=T " 隐藏工具栏。 “设置背景=浅色”背景。 setlines=40columns=100" 窗口尺寸。set

guioptions-=r" 不要显示右滚动条


任何有关如何解决此问题的建议将不胜感激。

Configured vim and gvim on Windows, as well as vim and macvim on OSX. Intend to learn rails 3, so installed rails 3 rc on both OS'ses. So far, so good.

When using macvim, each and every script execution offered by rails.vim gives me errors "Uninitialized constant Bundler (NameError)". Tried :Rserver, :Rgenerate, .... However, staying on OSX, when firing up vim from a terminal window, rails.vim runs just fine, as well as execution of the rails script from the terminal directly.

So somewhere, somehow my macvim configuration seems to mess things up. However, unless I'm mistaken, it simply uses the settings from the .vimrc and .gvimrc files. Now, the .gvimrc is really minimalistic, so I might just as well add it here:


set guifont=Inconsolata:h17 " Font family and font size.
set antialias " MacVim: smooth fonts.
set encoding=utf-8 " Use UTF-8 everywhere.
set guioptions-=T " Hide toolbar.
" set background=light " Background.
set lines=40 columns=100 " Window dimensions.

set guioptions-=r " Don't show right scrollbar


Any suggestion on how to solve this would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

活泼老夫 2024-09-19 12:17:17

您的 $PATH 可能在 MacVim 中设置不正确,或者您的环境中缺少其他内容?

尝试使用 :shell 从 MacVim 启动 shell,并手动运行 ruby​​ 命令,看看是否出现相同的错误。您还可以尝试使用 :new | 比较 MacVim 和终端 vim 之间的环境变量。读取每个中的 !env

Your $PATH may not be set correctly in MacVim, or perhaps something else is missing from your environment?

Try starting a shell from MacVim using :shell and run the ruby commands manually to see if you get the same error. You could also try comparing environment variables between MacVim and Terminal vim using :new | read !env in each.

守护在此方 2024-09-19 12:17:17

Vim 7.3 版本于昨天发布。经检查,基于最新的 Vim 版本,新版本的 MacVim 已经构建完成。下载并测试后,rails.vim 脚本现在可以正常工作了!所以问题解决了。

Version 7.3 of Vim was released yesterday. Checked, and a new version of MacVim was already built, based on this latest Vim release. Downloaded and tested, and rails.vim scripts work the way they are supposed to now! So issue solved.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文