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 に問題があると言ったときに、それを正しく理解していると思います - 具体的には、strategy.rb の 136 行目です。
しかし、私は 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