仅在生产中:activesupport-4.1.4 / lib / active_support / dependencies无法加载此类文件

时间:2015-09-26 11:24:44

标签: ruby-on-rails ruby gem rubygems

我在生产模式下运行应用程序时遇到此错误。然而,当我在开发模式下运行它时,一切正常,没有错误。这是我运行“rails'production”时遇到的完整错误。

  

D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in require': cannot load such file -- rack/handler/production (LoadError) from D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in阻止在'require'中           来自D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in load_dependency' from D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in require'           来自D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.5.5/lib/rack/handler.rb:76:in   try_require' from D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.5.5/lib/rack/handler.rb:16:in 得到”           来自D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rack-1.5.5/lib/rack/server.rb:268:in   server' from D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/server.rb:112:in print_boot_information”           来自D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/server.rb:64:in   start' from D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in 阻止服务器'           来自D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in   tap' from D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in 服务器”           来自D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in   run_command!' from D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in ”           来自bin / rails:4:require' from bin/rails:4:in'

我的宝石文件:

    source 'https://rubygems.org'

    #Gem allows to transfer data from dev to production database
    gem 'yaml_db'

    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
    gem 'rails', '4.1.4'
    # Use sqlite3 as the database for Active Record
    gem 'sqlite3'
    #gem 'pg'
    # Use SCSS for stylesheets
    gem 'sass-rails', '~> 4.0.3'
    # Use Uglifier as compressor for JavaScript assets
    gem 'uglifier', '>= 1.3.0'
    # Use CoffeeScript for .js.coffee assets and views
    gem 'coffee-rails', '~> 4.0.0'
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes
    # gem 'therubyracer',  platforms: :ruby

    # Use jquery as the JavaScript library
    gem 'jquery-rails'
    # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
    gem 'turbolinks'
    # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
    gem 'jbuilder', '~> 2.0'
    # bundle exec rake doc:rails generates the API under doc/api.
    gem 'sdoc', '~> 0.4.0',          group: :doc

    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring',        group: :development

    # Use ActiveModel has_secure_password
    # gem 'bcrypt', '~> 3.1.7'

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

    # Use Capistrano for deployment
    # gem 'capistrano-rails', group: :development

    # Use debugger
    # gem 'debugger', group: [:development, :test]

    gem 'bundler'

    gem "font-awesome-rails"

    gem "private_pub"
    gem "thin"

    gem 'gravatar-ultimate'

    gem "haml"

    gem 'whenever'

    # gem 'forem', github: "radar/forem", branch: "rails4"

    # gem 'will_paginate', '3.0.5'

    group :development do
      gem 'pry-rails'
      gem 'better_errors'
    end

    gem 'delayed_job_active_record'
    gem 'acts_as_votable', github: 'ryanto/acts_as_votable'
    gem 'binding_of_caller'
    gem 'simple_form'
    gem 'devise', github: 'plataformatec/devise'
    gem 'omniauth'
    gem 'omniauth-facebook'
    gem 'activeadmin', github: 'gregbell/active_admin'
    gem 'google-analytics-rails'
    gem 'rails_config'
    gem 'bootstrap-sass', '3.3.5'
    gem 'bootstrap-sass-extras'
    gem 'validates_formatting_of'
    gem 'tzinfo-data'

    group :development, :test do
      gem 'dotenv-rails'
      gem 'rspec-rails'
      gem 'factory_girl_rails'
    end

    group :test do
      gem 'shoulda-matchers'
      gem 'cucumber-rails', require: false
      gem 'database_cleaner'
    end
And gemfile.lock:

GIT
  remote: git://github.com/gregbell/active_admin.git
  revision: d44c1b8a57cc893f0b3dae6a7e6cb5c9bc09be29
  specs:
    activeadmin (1.0.0.pre1)
      arbre (~> 1.0, >= 1.0.2)
      bourbon
      coffee-rails
      formtastic (~> 3.1)
      formtastic_i18n
      inherited_resources (~> 1.6)
      jquery-rails
      jquery-ui-rails (~> 5.0)
      kaminari (~> 0.15)
      rails (>= 3.2, < 5.0)
      ransack (~> 1.3)
      sass-rails

GIT
  remote: git://github.com/plataformatec/devise.git
  revision: b12658782ff41cbd2e418a4974779f51e3675466
  specs:
    devise (3.5.2)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 3.2.6, < 5)
      responders
      thread_safe (~> 0.1)
      warden (~> 1.2.3)

GIT
  remote: git://github.com/ryanto/acts_as_votable.git
  revision: 9ded371ec0720d07fa7a169109da05c835a2cb51
  specs:
    acts_as_votable (0.10.0)

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.4)
      actionpack (= 4.1.4)
      actionview (= 4.1.4)
      mail (~> 2.5.4)
    actionpack (4.1.4)
      actionview (= 4.1.4)
      activesupport (= 4.1.4)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.4)
      activesupport (= 4.1.4)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.1.4)
      activesupport (= 4.1.4)
      builder (~> 3.1)
    activerecord (4.1.4)
      activemodel (= 4.1.4)
      activesupport (= 4.1.4)
      arel (~> 5.0.0)
    activesupport (4.1.4)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    addressable (2.3.8)
    arbre (1.0.3)
      activesupport (>= 3.0.0)
    arel (5.0.1.20140414130214)
    autoprefixer-rails (5.2.1.2)
      execjs
      json
    bcrypt (3.1.10)
    bcrypt (3.1.10-x86-mingw32)
    better_errors (2.1.1)
      coderay (>= 1.0.0)
      erubis (>= 2.6.6)
      rack (>= 0.9.0)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    bootstrap-sass (3.3.5)
      autoprefixer-rails (>= 5.0.0.1)
      sass (>= 3.2.19)
    bootstrap-sass-extras (0.0.6)
      rails (>= 3.1.0)
    bourbon (3.2.4)
      sass (~> 3.2)
      thor
    builder (3.2.2)
    capybara (2.4.4)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    chronic (0.10.2)
    coderay (1.1.0)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.9.1.1)
    config (1.0.0)
      activesupport (>= 3.0)
      deep_merge (~> 1.0.0)
    cookiejar (0.3.2)
    cucumber (1.3.20)
      builder (>= 2.1.2)
      diff-lcs (>= 1.1.3)
      gherkin (~> 2.12)
      multi_json (>= 1.7.5, < 2.0)
      multi_test (>= 0.1.2)
    cucumber-rails (1.4.2)
      capybara (>= 1.1.2, < 3)
      cucumber (>= 1.3.8, < 2)
      mime-types (>= 1.16, < 3)
      nokogiri (~> 1.5)
      rails (>= 3, < 5)
    daemons (1.2.3)
    database_cleaner (1.4.1)
    debug_inspector (0.0.2)
    deep_merge (1.0.1)
    delayed_job (4.0.6)
      activesupport (>= 3.0, < 5.0)
    delayed_job_active_record (4.0.3)
      activerecord (>= 3.0, < 5.0)
      delayed_job (>= 3.0, < 4.1)
    diff-lcs (1.2.5)
    dotenv (2.0.2)
    dotenv-rails (2.0.2)
      dotenv (= 2.0.2)
      railties (~> 4.0)
    em-http-request (1.1.2)
      addressable (>= 2.3.4)
      cookiejar
      em-socksify (>= 0.3)
      eventmachine (>= 1.0.3)
      http_parser.rb (>= 0.6.0)
    em-socksify (0.3.0)
      eventmachine (>= 1.0.0.beta.4)
    erubis (2.7.0)
    eventmachine (1.0.8)
    execjs (2.6.0)
    factory_girl (4.5.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.5.0)
      factory_girl (~> 4.5.0)
      railties (>= 3.0.0)
    faraday (0.9.1)
      multipart-post (>= 1.2, < 3)
    faye (1.1.2)
      cookiejar (>= 0.3.0)
      em-http-request (>= 0.3.0)
      eventmachine (>= 0.12.0)
      faye-websocket (>= 0.9.1)
      multi_json (>= 1.0.0)
      rack (>= 1.0.0)
      websocket-driver (>= 0.5.1)
    faye-websocket (0.10.0)
      eventmachine (>= 0.12.0)
      websocket-driver (>= 0.5.1)
    font-awesome-rails (4.4.0.0)
      railties (>= 3.2, < 5.0)
    formtastic (3.1.3)
      actionpack (>= 3.2.13)
    formtastic_i18n (0.4.1)
    gherkin (2.12.2)
      multi_json (~> 1.3)
    gherkin (2.12.2-x86-mingw32)
      multi_json (~> 1.3)
    google-analytics-rails (0.0.6)
    gravatar-ultimate (2.0.0)
      activesupport (>= 2.3.14)
      rack
    haml (4.0.7)
      tilt
    has_scope (0.6.0)
      actionpack (>= 3.2, < 5)
      activesupport (>= 3.2, < 5)
    hashie (3.4.2)
    hike (1.2.3)
    http_parser.rb (0.6.0)
    i18n (0.7.0)
    inherited_resources (1.6.0)
      actionpack (>= 3.2, < 5)
      has_scope (~> 0.6.0.rc)
      railties (>= 3.2, < 5)
      responders
    jbuilder (2.3.1)
      activesupport (>= 3.0.0, < 5)
      multi_json (~> 1.2)
    jquery-rails (3.1.3)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (5.0.5)
      railties (>= 3.2.16)
    json (1.8.3)
    jwt (1.5.1)
    kaminari (0.16.3)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    method_source (0.8.2)
    mime-types (1.25.1)
    mini_portile (0.6.2)
    minitest (5.8.0)
    multi_json (1.11.2)
    multi_test (0.1.2)
    multi_xml (0.5.5)
    multipart-post (2.0.0)
    nokogiri (1.6.6.2)
      mini_portile (~> 0.6.0)
    nokogiri (1.6.6.2-x86-mingw32)
      mini_portile (~> 0.6.0)
    oauth2 (1.0.0)
      faraday (>= 0.8, < 0.10)
      jwt (~> 1.0)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (~> 1.2)
    omniauth (1.2.2)
      hashie (>= 1.2, < 4)
      rack (~> 1.0)
    omniauth-facebook (2.0.1)
      omniauth-oauth2 (~> 1.2)
    omniauth-oauth2 (1.3.1)
      oauth2 (~> 1.0)
      omniauth (~> 1.2)
    orm_adapter (0.5.0)
    polyamorous (1.2.0)
      activerecord (>= 3.0)
    polyglot (0.3.5)
    private_pub (1.0.3)
      faye
    pry (0.10.1)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    pry (0.10.1-x86-mingw32)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
      win32console (~> 1.3)
    pry-rails (0.3.4)
      pry (>= 0.9.10)
    rack (1.5.5)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.1.4)
      actionmailer (= 4.1.4)
      actionpack (= 4.1.4)
      actionview (= 4.1.4)
      activemodel (= 4.1.4)
      activerecord (= 4.1.4)
      activesupport (= 4.1.4)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.1.4)
      sprockets-rails (~> 2.0)
    rails_config (0.99.0)
      config (>= 1.0.0.beta1)
    railties (4.1.4)
      actionpack (= 4.1.4)
      activesupport (= 4.1.4)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.4.2)
    ransack (1.7.0)
      actionpack (>= 3.0)
      activerecord (>= 3.0)
      activesupport (>= 3.0)
      i18n
      polyamorous (~> 1.2)
    rdoc (4.2.0)
      json (~> 1.4)
    responders (1.1.2)
      railties (>= 3.2, < 4.2)
    rspec-core (3.3.2)
      rspec-support (~> 3.3.0)
    rspec-expectations (3.3.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.3.0)
    rspec-mocks (3.3.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.3.0)
    rspec-rails (3.3.3)
      actionpack (>= 3.0, < 4.3)
      activesupport (>= 3.0, < 4.3)
      railties (>= 3.0, < 4.3)
      rspec-core (~> 3.3.0)
      rspec-expectations (~> 3.3.0)
      rspec-mocks (~> 3.3.0)
      rspec-support (~> 3.3.0)
    rspec-support (3.3.0)
    sass (3.2.19)
    sass-rails (4.0.5)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.2)
      sprockets (~> 2.8, < 3.0)
      sprockets-rails (~> 2.0)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    shoulda-matchers (2.8.0)
      activesupport (>= 3.0.0)
    simple_form (3.1.0)
      actionpack (~> 4.0)
      activemodel (~> 4.0)
    slop (3.6.0)
    spring (1.3.6)
    sprockets (2.12.4)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.3.2)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (>= 2.8, < 4.0)
    sqlite3 (1.3.10)
    sqlite3 (1.3.10-x86-mingw32)
    thin (1.6.3)
      daemons (~> 1.0, >= 1.0.9)
      eventmachine (~> 1.0)
      rack (~> 1.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    turbolinks (2.5.3)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    tzinfo-data (1.2015.6)
      tzinfo (>= 1.0.0)
    uglifier (2.7.1)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    validates_formatting_of (0.9.0)
      activemodel
    warden (1.2.3)
      rack (>= 1.0)
    websocket-driver (0.6.2)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)
    whenever (0.9.4)
      chronic (>= 0.6.3)
    win32console (1.3.2-x86-mingw32)
    xpath (2.0.0)
      nokogiri (~> 1.3)
    yaml_db (0.3.0)
      rails (>= 3.0, < 4.3)
      rake (>= 0.8.7)

PLATFORMS
  ruby
  x86-mingw32

DEPENDENCIES
  activeadmin!
  acts_as_votable!
  better_errors
  binding_of_caller
  bootstrap-sass (= 3.3.5)
  bootstrap-sass-extras
  bundler
  coffee-rails (~> 4.0.0)
  cucumber-rails
  database_cleaner
  delayed_job_active_record
  devise!
  dotenv-rails
  factory_girl_rails
  font-awesome-rails
  google-analytics-rails
  gravatar-ultimate
  haml
  jbuilder (~> 2.0)
  jquery-rails
  omniauth
  omniauth-facebook
  private_pub
  pry-rails
  rails (= 4.1.4)
  rails_config
  rspec-rails
  sass-rails (~> 4.0.3)
  sdoc (~> 0.4.0)
  shoulda-matchers
  simple_form
  spring
  sqlite3
  thin
  turbolinks
  tzinfo-data
  uglifier (>= 1.3.0)
  validates_formatting_of
  whenever
  yaml_db

BUNDLED WITH
   1.10.6

我不确定是什么原因造成的。我尝试卸载所有宝石并重新安装。我可以说的一件事是,在我没有使用之前

BUNDLED WITH
       1.10.6

位于gemlock文件的底部。

请让我知道这可能是什么。

1 个答案:

答案 0 :(得分:1)

想出来。

正确的命令是rails s -e production而不是rails s production