当我运行RAILS_ENV=development rails s
我的应用程序时工作正常。但是当我运行时,RAILS_ENV=production rails s
我收到消息:
christophecompaq@ubuntu:~/FunkyApp$ RAILS_ENV=production rails s
DEPRECATION WARNING: require "activerecord" is deprecated and will be removed in Rails 3. Use require "active_record" instead. (called from /usr/lib/ruby/vendor_ruby/activerecord.rb:2)
=> Booting WEBrick
=> Rails 3.2.3 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/var/lib/gems/1.8/gems/omniauth-1.1.0/lib/omniauth/strategy.rb:136:in `initialize': Received wrong number of arguments. [nil] (ArgumentError)
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `new'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:43:in `build'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `build'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:282:in `inject'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `each'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `inject'
from /var/lib/gems/1.8/gems/actionpack-3.2.3/lib/action_dispatch/middleware/stack.rb:113:in `build'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/engine.rb:470:in `build_middleware_stack'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application/finisher.rb:31
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
from /var/lib/gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/christophecompaq/FunkyApp/config/environment.rb:5
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/lib/gems/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /home/christophecompaq/FunkyApp/config.ru:4
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /home/christophecompaq/FunkyApp/config.ru:1:in `new'
from /home/christophecompaq/FunkyApp/config.ru:1
christophecompaq@ubuntu:~/FunkyApp$
以我有限的 Rails 知识,当我说omniauth gem 存在问题时,我想我是正确的 - 尤其是第 136 行的 strategy.rb。
但我从来没有改变过我的 var/lib/gems 文件夹中的任何内容。当我将我的 strategy.rb 与 github 上的进行比较时:https ://github.com/intridea/omniauth/blob/v1.1.0/lib/omniauth/strategy.rb#L124我得到完全相同的文件 - 甚至格式相同。
我有我的应用程序的备份,即使我进入这些备份文件夹并且RAILS_ENV=production rails s
我得到完全相同的错误消息 - 这会让我相信这是一些核心依赖项/gem文件问题,而不是我不小心更改的一些配置/部署问题我的应用程序文件夹。(尽管我可能错了!...) 大约 3 周前一切正常 - 完全没有rails s
错误
我只是在抛出想法,但可能在 .bashrc、.bash_profile 中?...我不知道。任何帮助,将不胜感激!
编辑:添加我的gemfile,如下:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'rake', '~> 10.0.4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2', '~> 0.3.11'
gem 'json', '~> 1.7.3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'compass-rails', '~> 1.0.1'
gem 'bootstrap-sass', '~> 2.0.2'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', '~> 0.10.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'jquery-fileupload-rails'
end
gem 'jquery-rails', '~> 2.0.2'
gem 'inherited_resources', '~> 1.3.1'
gem 'simple_form', '~> 2.0.2'
gem 'will_paginate', '~> 3.0.3'
gem 'bootstrap-will_paginate', '~> 0.0.7'
gem 'has_scope', '~> 0.5.1'
gem "best_in_place", "~> 1.1.2"
gem 'devise', '~> 2.0.4'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'linkedin'
gem 'omnicontacts', '~> 0.2.3'
gem 'SystemTimer', '~> 1.2.3'
gem 'resque', '~> 1.20.0'
gem 'resque-scheduler', :require => 'resque_scheduler'
gem 'rest-client', '~> 1.6.7'
gem 'rest-graph', '~> 2.0.1'
gem 'geokit', '=1.6.5'
gem 'geokit-rails3', '~> 0.1.5'
gem 'memcache-client'
gem 'forgery', '~> 0.5.0'
gem 'factory_girl_rails', '~> 1.7.0'
gem "amoeba", "~> 1.2.1"
# 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'
group :development do
gem 'mongrel'
gem 'pry-rails'
gem 'quiet_assets'
gem 'email_spec'
gem 'capistrano', '~> 2.12.0'
gem 'capistrano-ext', '~> 1.2.1'
gem 'rvm-capistrano', '~> 1.2.1'
gem 'ruby-debug-base', '=0.10.4'
gem 'ruby-debug', '=0.10.4'
gem 'annotate'
gem 'letter_opener', :git => 'https://github.com/ryanb/letter_opener.git'
gem 'localtunnel'
end
group :test do
gem 'cucumber-rails', '~> 1.3.0', :require => false
gem 'capybara-webkit', '~> 0.11.0'
gem 'headless', '~> 0.3.1'
gem 'database_cleaner', '~> 0.7.2'
gem 'rspec-rails', '~> 2.9.0'
gem 'email_spec'
end