2011-10-11 67 views
3

我拉着头发试图在DH上启动VPS上的简单应用程序。试图在Dreamhost上测试VPS上的应用程序

步骤1:创建的测试应用程式

$ rails new test app 

步骤2:改性配置/ environment.rb中:

require File.expand_path('../application', __FILE__) 

if ENV['RAILS_ENV'] == 'production' # don't bother on dev 
    ENV['GEM_PATH'] = '/home/feebzee/.gems' + ':/usr/lib/ruby/gems/1.8' 
end 

# Initialize the rails application 
Testapp::Application.initialize! 

应用运行正常使用的WEBrick在端口3000。但是,如果我让乘客负载它可以达到Rails欢迎登录页面,即使在点击链接显示应用程序环境时也会返回错误。

我附上了下面的错误消息以供您欣赏。提前致谢,并去RoR! :-)

Error message: 
no such file to load -- bundler/setup 

Exception class: 
LoadError 

Application root: 
/home/feebzee/testapp 



# Initialize the rails application 
Testapp::Application.initialize! 
# File Line Location 
0 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require' 
1 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require' 
2 /home/feebzee/testapp/config/boot.rb 6 
3 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require' 
4 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require' 
5 /home/feebzee/testapp/config/application.rb 1 
6 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require' 
7 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require' 
8 /home/feebzee/testapp/config/environment.rb 2 
9 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require' 
10 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require' 
11 config.ru 3 
12 /var/lib/gems/1.8/gems/rack-1.3.4/lib/rack/builder.rb 51 in `instance_eval' 
13 /var/lib/gems/1.8/gems/rack-1.3.4/lib/rack/builder.rb 51 in `initialize' 
14 config.ru 1 in `new' 
15 config.ru 1 

回答

0

您是否为您使用的环境安装了捆绑软件gem?

0

默认情况下,WEBrick以开发模式运行,但乘客默认在生产模式下运行。

以下配置:

if ENV['RAILS_ENV'] == 'production' # don't bother on dev 
    ENV['GEM_PATH'] = '/home/feebzee/.gems' + ':/usr/lib/ruby/gems/1.8' 
end 

...意味着你想运行您使用的WEBrick时不是乘客时加载一个宝石 - 假设你没有指定环境明确自己。

尝试运行bundle install

相关问题