使用 POW 运行的应用程序无法启动(捆绑程序认为 gem 丢失)
错误在此块中,
begin
# Set up load paths for all bundled gems
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
Bundler.setup
rescue Bundler::GemNotFound
raise RuntimeError, "Bundler couldn't find some gems." +
"Did you run `bundle install`?"
end
我如何知道它认为缺少什么宝石?我已经在我的 gemset 和系统 ruby 中完成了捆绑安装。
有没有办法将 gem 捆绑程序认为缺少的名称添加到运行时错误捆绑程序消息中?
error is in this block
begin
# Set up load paths for all bundled gems
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
Bundler.setup
rescue Bundler::GemNotFound
raise RuntimeError, "Bundler couldn't find some gems." +
"Did you run `bundle install`?"
end
how do I know what gem it thinks is missing? I've done bundle install in my gemset and in the system ruby.
Is there a way to add the name of the gem bundler thinks is missing to the runtime error bundler message?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否在尝试运行 ruby 命令之前尝试过bundle exec?
另外,如果您使用 RVM,我建议在项目目录中创建一个 .rvmrc 文件,以便 gemset 是您需要的文件,它们的形式为:
rvm use ree-1.8.7-2010.02@admin_app --create
This当您进入该目录时,会将您的 gemset 和 ruby 版本重置为您指定的版本。
更新:.rvmrc 已弃用,而是创建 .ruby-version 和 .ruby-gemset。这意味着您可以使用 rvm 或其他 ruby 版本管理器之一。
Have you tried bundle exec before the ruby command you are trying to run?
Also, if you're using RVM I would advise creating a .rvmrc file in your project directory so the gemset is the one you need, they are of the form:
rvm use ree-1.8.7-2010.02@admin_app --create
This will reset your gemset and ruby version to whatever you specify when you come to that directory.
UPDATE: .rvmrc is deprecated, instead you create .ruby-version and .ruby-gemset. This means you can use rvm or one of the other ruby version managers.