0

这个问题已经困扰了我好几个小时了。我正在共享托管站点中部署 Rails3 应用程序。我已经能够在本地 Ubuntu 上运行该站点。它运作良好。但是当我尝试在线部署它时,它并不能很好地工作。所以我认为这可能与版本有关。另外,我没有在我的任何模块中使用这个 gem。错误信息如下:

A source file that the application requires, is missing.
It is possible that you didn't upload your application files correctly. Please check whether all your application files are uploaded.
A required library may not installed. Please install all libraries that this application requires.
Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem.

Error message:
No such file to load -- FasterCSV
Exception class:
LoadError

回溯:

#   File    Line    Location
0   /home/dev/project/vendor/bundle/ruby/1.8/gems/activesupport-3.1.4/lib/active_support/dependencies.rb    306 in `depend_on'
1   /home/dev/project/vendor/bundle/ruby/1.8/gems/activesupport-3.1.4/lib/active_support/dependencies.rb    214 in `require_dependency'
2   /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/engine.rb    417 in `eager_load!'
3   /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/engine.rb    416 in `each'
4   /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/engine.rb    416 in `eager_load!'
5   /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/engine.rb    414 in `each'
6   /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/engine.rb    414 in `eager_load!'
7   /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/application/finisher.rb  51  
8   /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/initializable.rb 30  in `instance_exec'
9   /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/initializable.rb 30  in `run'
10  /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/initializable.rb 55  in `run_initializers'
11  /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/initializable.rb 54  in `each'
12  /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/initializable.rb 54  in `run_initializers'
13  /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/application.rb   96  in `initialize!'
14  /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/railtie/configurable.rb  30  in `send'
15  /home/dev/project/vendor/bundle/ruby/1.8/gems/railties-3.1.4/lib/rails/railtie/configurable.rb  30  in `method_missing'
16  /home/dev/project/config/environment.rb 15  
17  config.ru   3   in `require'
18  config.ru   3   
19  /home/dev/project/vendor/bundle/ruby/1.8/gems/rack-1.3.6/lib/rack/builder.rb    51  in `instance_eval'
20  /home/dev/project/vendor/bundle/ruby/1.8/gems/rack-1.3.6/lib/rack/builder.rb    51  in `initialize'
21  config.ru   1   in `new'
22  config.ru   1   

Ruby -v 返回

ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

Rails -v 返回

Rails 3.1.4

我正在使用 Phusion Passenger 部署应用程序。

任何帮助都可以。提前致谢。

更新:

这是config.ru

require ::File.expand_path('../config/environment',  __FILE__)
run project::Application

环境.rb

# Load the rails application

#require 'will_paginate'
require 'rubygems'
require 'composite_primary_keys'
require 'logger'
require 'json'
#require 'composite_primary_keys'
require File.expand_path('../application', __FILE__)



# Initialize the rails application
Dealmap::Application.initialize!
Rails.logger = Logger.new(STDOUT)

宝石文件:

source 'http://rubygems.org'

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

gem 'mysql2', '0.3.11'
#gem 'typus'
gem 'nokogiri'
gem 'geokit'
gem 'composite_primary_keys'
gem "rake", "0.8.7"
gem 'geocoder'
gem 'htmlentities'
gem 'json'
gem 'execjs'
gem 'therubyracer'
gem 'activeadmin'
gem "meta_search",    '>= 1.1.0.pre'
gem "nifty-generators", :group => :development
gem 'fastercsv'

gem 'gmaps4rails'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.1.5'
  gem 'coffee-rails', '~> 3.1.1'
  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 web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

gem "mocha", :group => :test

注意:我明确地将项目名称更改为“项目”。另外,我最近gem 'fastercsv'在显示错误后在 Gemfile 中添加了该行。

非常感谢!

4

1 回答 1

0

我向支持人员寻求帮助。似乎错误是我在.htaccess 中指向了错误的应用程序版本。

问题解决了。

于 2012-05-30T08:03:03.517 回答