-1

我可以在我的本地工作,但在我的 webfaction 的服务器上,我得到以下堆栈跟踪:

堆栈跟踪:

There was an error in your Gemfile, and Bundler cannot continue. (Bundler::GemfileError)
  /home/vegan/webapps/lab95ror/gems/gems/bundler-1.2.3/lib/bundler/dsl.rb:12:in `rescue in evaluate'
  /home/vegan/webapps/lab95ror/gems/gems/bundler-1.2.3/lib/bundler/dsl.rb:6:in `evaluate'
  /home/vegan/webapps/lab95ror/gems/gems/bundler-1.2.3/lib/bundler/definition.rb:18:in `build'
  /home/vegan/webapps/lab95ror/gems/gems/bundler-1.2.3/lib/bundler.rb:144:in `definition'
  /home/vegan/webapps/lab95ror/gems/gems/bundler-1.2.3/lib/bundler.rb:112:in `setup'
  /home/vegan/webapps/lab95ror/gems/gems/bundler-1.2.3/lib/bundler/setup.rb:17:in `<top (required)>'
  /usr/local/lib/ruby20/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
  /usr/local/lib/ruby20/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
  /usr/local/lib/ruby20/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
  /home/vegan/webapps/lab95ror/gems/gems/passenger-4.0.2/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code'
  /home/vegan/webapps/lab95ror/gems/gems/passenger-4.0.2/helper-scripts/rack-loader.rb:69:in `load_app'
  /home/vegan/webapps/lab95ror/gems/gems/passenger-4.0.2/helper-scripts/rack-loader.rb:96:in `<module:App>'
  /home/vegan/webapps/lab95ror/gems/gems/passenger-4.0.2/helper-scripts/rack-loader.rb:4:in `<module:PhusionPassenger>'
  /home/vegan/webapps/lab95ror/gems/gems/passenger-4.0.2/helper-scripts/rack-loader.rb:3:in `<main>'

我认为这与我的 nginx 配置有关?

nginx.conf

http {
    access_log  /home/vegan/logs/user/access_lab95ror.log  combined;
    error_log   /home/vegan/logs/user/error_lab95ror.log   crit;

    include         mime.types;
    passenger_root  /home/vegan/webapps/lab95ror/gems/gems/passenger-4.0.2;
    passenger_ruby  /home/vegan/webapps/lab95ror/bin/ruby;
    sendfile        on;

    passenger_max_instances_per_app  1;
    rails_spawn_method               conservative;
    passenger_max_pool_size 2;

    server {
        listen             19855;
        passenger_enabled  on;
        root               /home/vegan/webapps/lab95ror/lab95/public;
        server_name        localhost;

尝试重新安装与我的开发机器上相同版本的捆绑程序

[vegan@web349 lab95]$ gem install bundler -v 1.3.5
Successfully installed bundler-1.3.5
1 gem installed
Installing ri documentation for bundler-1.3.5...
Installing RDoc documentation for bundler-1.3.5...
[vegan@web349 lab95]$ bundle install
-bash: bundle: command not found

我还在他们的论坛上发帖:http: //community.webfaction.com/questions/13688/cannot-deploy-new-rails-app

宝石文件

source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
gem 'figaro'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

gem 'json'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'less'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platform => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

在“我们很抱歉,但出了点问题”之后更新 Nginx 错误日志。

[ 2013-06-12 14:15:10.5040 22627/7f825b76f700 Pool2/Spawner.h:739 ]: [App 22748 stdout]
[ 2013-06-12 14:15:11.7469 22627/7f825b72e700 Pool2/Spawner.h:159 ]: [App 22748 stderr]         SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
[ 2013-06-12 14:15:11.7470 22627/7f825b72e700 Pool2/Spawner.h:159 ]: [App 22748 stderr]         This poses a security threat. It is strongly recommended that you
[ 2013-06-12 14:15:11.7470 22627/7f825b72e700 Pool2/Spawner.h:159 ]: [App 22748 stderr]         provide a secret to prevent exploits that may be possible from crafted
[ 2013-06-12 14:15:11.7470 22627/7f825b72e700 Pool2/Spawner.h:159 ]: [App 22748 stderr]         cookies. This will not be supported in future versions of Rack, and
[ 2013-06-12 14:15:11.7470 22627/7f825b72e700 Pool2/Spawner.h:159 ]: [App 22748 stderr]         future versions will even invalidate your existing user cookies.
[ 2013-06-12 14:15:11.7470 22627/7f825b72e700 Pool2/Spawner.h:159 ]: [App 22748 stderr]
[ 2013-06-12 14:15:11.7470 22627/7f825b72e700 Pool2/Spawner.h:159 ]: [App 22748 stderr]         Called from: /home/vegan/webapps/lab95ror/gems/gems/actionpack-3.2.3/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.
4

2 回答 2

2

听起来 Bundler 可能不在您的系统路径中。从关于 Rails 安装的WebFaction 文档中:

export GEM_HOME=$PWD/gems
export RUBYLIB=$PWD/lib
export PATH=$PWD/bin:$PATH

然后,尝试安装/重新安装 Bundler:

gem install bundler
于 2013-06-12T02:54:48.480 回答
0

$ rvm gemset 使用全局 && 捆绑

我有类似的问题尝试使用上面的代码安装。

于 2013-06-12T06:42:58.487 回答