简体   繁体   English

无法加载Rails Server(3.0.11,ruby 1.9.2),没有要加载的此类文件-链轮/ railtie(LoadError)

[英]Trouble loading Rails Server (3.0.11, ruby 1.9.2), no such file to load — sprockets/railtie (LoadError)

Using the Hartl tutorial. 使用Hartl教程。

Command: rails s 命令:rails

Response: 响应:

/Users/davidpardy/rails_projects/sample_app/config/application.rb:8:in `require': no such file     to load -- sprockets/railtie (LoadError)
    from /Users/davidpardy/rails_projects/sample_app/config/application.rb:8:in `<top     (required)>'
    from /Users/davidpardy/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails    /commands.rb:28:in `require'
    from /Users/davidpardy/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails    /commands.rb:28:in `block in <top (required)>'
    from /Users/davidpardy/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails    /commands.rb:27:in `tap'
    from /Users/davidpardy/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.11/lib/rails    /commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

application.rb file below 下面的application.rb文件

require File.expand_path('../boot', __FILE__)

# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
#require "rails/test_unit/railtie"

if defined?(Bundler)
  # If you precompile assets before deploying to production, use this line
  Bundler.require(*Rails.groups(:assets => %w(development test)))
  # If you want your assets lazily compiled in production, use this line
  #Bundler.require(:default, :assets, Rails.env)
end

module SampleApp
  class Application < Rails::Application
    config.encoding = "utf-8"
    config.filter_parameters += [:password]
    config.assets.enabled = true
    config.assets.version = '1.0'
  end
end

Tried commenting out sprockets, just created more problems (and nothing came of that, unfortunately). 尝试注释掉链轮,只会造成更多问题(不幸的是,事情并没有解决)。

WUG thoughts? WUG的想法?

You've downgraded your app to rails 3.0 but there are still a number of places with your application references 3.1 only methods or files. 您已经将应用程序降级到Rails 3.0,但是在很多地方您的应用程序仅引用3.1方法或文件。

sprockets/railtie is one of those, there will also be settings in your environment.rb referring to the asset pipeline and probably some others too (the wrap params stuff springs to mind). 链轮/轨道是其中之一,您的environment.rb中还将有一些设置指向资产管道,可能还涉及其他一些设置(包装参数会浮现在脑海)。 You would need at the very least to remove all of those. 您至少需要删除所有这些。

As someone new to rails I'd strongly suggest you start with the version of rails the tutorial you are following was written for and stick with it. 作为Rails的新手,我强烈建议您从Rails的版本开始,并遵循您所遵循的教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 rails生成rspec:install - 没有这样的文件加载--sprockets / railtie(LoadError) - rails generate rspec:install - no such file to load --sprockets/railtie (LoadError) LoadError:无法加载此类文件-Heroku Ruby on Rails上的travis - LoadError: cannot load such file — travis on Heroku Ruby on Rails Rails 7 Ruby 3.1 LoadError:无法加载此类文件--net/smtp - Rails 7 Ruby 3.1 LoadError: cannot load such file -- net/smtp Ruby on Rails:错误“require”:无法加载此类文件——bundler/setup (LoadError) - Ruby on Rails: Error `require': cannot load such file -- bundler/setup (LoadError) Ruby:`gem_original_require&#39;:没有这样的文件要加载 - rails(LoadError) - Ruby: `gem_original_require': no such file to load — rails (LoadError) Rails/Ruby/Postgres - LoadError 无法加载此类文件 -- pg_ext - Rails/Ruby/Postgres - LoadError cannot load such file -- pg_ext 诊断 Ruby-on-Rails App: LoadError: cannot load such file -- enumerator - Diagnosing Ruby-on-Rails App: LoadError: cannot load such file -- enumerator Ruby on Rails: LoadError: cannot load such file — paypal-express - Ruby on Rails: LoadError: cannot load such file — paypal-express Ruby LoadError 无法加载此类文件 - Ruby LoadError cannot load such file Ruby-无法加载文件(LoadError) - Ruby - Cannot Load File (LoadError)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM