0

我正在尝试运行这个应用程序,它的最后一次提交大约是一年前。在花了很长时间尝试安装所有 gem 和 gem 依赖项(包括注释掉metric-fugem)之后,我能够得到绿灯“捆绑已完成”消息。但是,在运行服务器时,我收到以下错误日志:

Rails 3.2.9 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/zallanx/rails_projects/smartr/config/environment.rb:5)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/zallanx/rails_projects/smartr/config/environment.rb:5)
Exiting
/Users/zallanx/rails_projects/smartr/config/environments/development.rb:26:in `block in <top (required)>': uninitialized constant Sass::Plugin (NameError)
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:24:in `class_eval'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:24:in `configure'
    from /Users/zallanx/rails_projects/smartr/config/environments/development.rb:1:in `<top (required)>'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/engine.rb:571:in `block in <class:Engine>'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/zallanx/rails_projects/smartr/config/environment.rb:5:in `<top (required)>'
    from /Users/zallanx/rails_projects/smartr/config.ru:2:in `block in <main>'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
    from /Users/zallanx/rails_projects/smartr/config.ru:1:in `new'
    from /Users/zallanx/rails_projects/smartr/config.ru:1:in `<main>'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/commands/server.rb:46:in `app'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/commands/server.rb:70:in `start'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/commands.rb:55:in `block in <top (required)>'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/commands.rb:50:in `tap'
    from /Users/zallanx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.9/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:9:in `require'
    from script/rails:9:in `<main>'

旧的 Rails 2.3 插件会让我失望吗?这是我在 Hartl 的 Rails 教程之后的第一个“真实世界”项目,所以很遗憾我没有很多处理此类错误的经验。名为 smartr 的应用程序 Gemfile 已链接。谢谢!!

4

4 回答 4

1

当我在供应商文件夹中有一些 2.x 插件时,我遇到了类似的错误。删除它们后,错误消失了。

于 2013-01-05T04:53:32.350 回答
1

Sass 在 gemfile 中,但它的版本不受限制。由于该项目一年没有修改,因此该项目可能需要一个旧版本的 Sass。您应该尝试在 Gemfile 中研究降级 sass 并bundle update查看会发生什么。另外,Rails 3.2 一年前还没有发布,所以我不会在 Rails 3.2 上运行这个应用程序。

于 2013-01-05T05:11:38.043 回答
1

似乎名为 Sass::Plugin 的东西要么丢失,要么无法从您的应用程序中正确加载。

检查上述插件是否存在

高温高压

于 2013-01-05T05:15:04.973 回答
1

是一篇可以帮助您运行旧应用程序 wint Rails 4 的文章。请阅读这部分No More vendor/plugins,它描述了如何解决您的一个问题。

关于 sass-plugin 的第二个问题可以通过在 development.rb 中注释 26 字符串来解决。它必须写在 Rails 3 应用程序的其他地方。

于 2013-01-05T07:41:23.517 回答