8

I have a Rails 3 app ready for staging.

I haven't got a VPS host set up yet. As I was planning to have everything on shared host for the first few months.

Problem:

cd myapp bundle check result:

The Gemfile's dependencies are satisfied

Passenger error:

Error message:
    no such file to load -- bundler
Exception class:
    LoadError

Frustrating thing about shared hosts is that I have to add these lines on config.ru:

ENV['GEM_HOME'] = '/home/username/.gems'
ENV['GEM_PATH'] = '$GEM_HOME:/usr/lib/ruby/gems/1.8'

Still no luck. Same no such file to load bundler error appears.

Has anybody got this working? Rails 3, Debian, shared host (dreamhost)?

I could just go ahead and register on Slicehost/Fivebean but before I do, I'd like to know why that error is showing up.

Thanks.

4

6 回答 6

9

解决方案在这里http://rvm.beginrescueend.com/integration/passenger/。您需要将您的 HTTP 服务器指向passenger_ruby包装器而不是 bin/ ruby

例如,对于 RVM 和 Apache,它应该是这样的:

PassengerRuby /Users/username/.rvm/bin/passenger_ruby
于 2010-04-29T16:33:11.463 回答
4

乘客在加载之前不会从 config.ru 读取环境变量。没有你的回溯,我不能肯定,但我怀疑如果你只是跑步,一切都会奏效bundle lock。如果在那之后您仍然遇到问题,请在捆绑程序自述文件的底部有一个故障排除信息列表,我需要确切地知道发生了什么。

于 2010-04-03T16:40:22.110 回答
3

Rails hosting on shared hosts is already a minefield, but throwing in Rails 3 in all its pre-release goodness including Bundler reinventing the rubygems workflow is a recipe for pulling your hair out.

I host a few Rails sites on Dreamhost, but only the versions they officially support, otherwise it's just not worth the time. You can get a VPS now for almost as cheap as Dreamhost, and you will save hours and hours of your own time.

If you're looking for an easy answer, I'd suggest voting up the following and crossing your fingers:

Rails 3 on dreamhost?

于 2010-04-03T07:29:46.270 回答
2

对我来说,这被证明是乘客安装 nginx 模块在安装结束时吐出的乘客 ruby​​ 指令的问题。它在 ruby​​ 的路径中缺少 gemset 名称。

这有效:(修复)

passenger_ruby /Users/dzello/.rvm/wrappers/ruby-1.9.2-p0@rails3/ruby;

这没有:(乘客安装nginx模块吐出什么)

passenger_ruby /Users/dzello/.rvm/rubies/ruby-1.9.2-p0/bin/ruby

请注意,passenger_ruby 行不包含正确的 gem 路径 - @rails3(rails3 是 gemset 名称)部分丢失,即使它适合乘客根。

于 2011-02-02T07:32:19.243 回答
0

我在使用 vps plus rvm、rails3、capistrano 和 nginx 时遇到了这个问题。

乘客是由 root 安装的,但网站是由用户 fox 安装的。Nginx (root) 被配置为以 fox 身份运行应用程序。以 fox 身份登录时,Bundler 已安装,但以 root 身份运行 gem list bundler 时没有显示 gem。

乘客启动会给出错误捆绑器丢失。解决这个问题的唯一方法是将捆绑器安装为 root 和 fox。我猜乘客检查捆绑器而不是在 nginx 中配置的用户 fox 下。

于 2011-04-14T02:30:18.610 回答
0

随便找了个博客。它在“config.ru”中有一些行,这似乎对我有用。

ENV['GEM_HOME'] = '/home/farleyknight/.gems'
ENV['GEM_PATH'] = '$GEM_HOME:/usr/lib/ruby/gems/1.8'
require 'rubygems'
Gem.clear_paths

也许它会为你工作..

于 2010-04-27T22:08:21.400 回答