gpt4 book ai didi

ruby-on-rails-3 - 在生产模式下,我收到 - No such file to load -- ruby​​-debug (LoadError)

转载 作者:行者123 更新时间:2023-12-03 00:40:25 28 4
gpt4 key购买 nike

我正在使用 Rails 3.2.1,并且“ruby-debug19”行已在 Gemfile 中注释掉。当我以开发模式启动服务器时,服务器启动没有任何问题。但是,当我在生产模式下启动服务器时(rails server -e production),我最终收到以下错误(请参阅下面的堆栈跟踪):

... `rescue in depend_on': No such file to load -- ruby-debug (LoadError)

我花了相当多的时间试图找出谁需要重新调试,但没有运气。除了我的 Gemfile 和堆栈之外,不知道要包含什么。我真的很感激任何帮助。

还有一条信息:我的environment.rb 文件中的第5 行只是调用“Application.initialize!”

gem 文件:

gem 'rails', '3.2.1'
gem 'mysql'
gem 'gravatar_image_tag', '0.1.0'
gem "devise", ">= 1.4.9"
gem "paperclip", "~> 2.0"
gem 'jquery-rails'
gem 'aws-sdk'
gem 'aws-s3', :require => 'aws/s3'
gem 'formtastic'
gem 'cancan'
gem 'kaminari'
gem 'date_validator'
gem 'simple_form'
gem 'heroku'

gem 'pg', :group => :production

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.2.3"
gem 'coffee-rails', "~> 3.2.1"
gem 'uglifier', '>= 1.0.3'
end

gem 'annotate','2.4.1.beta1', :group => :development
gem 'nifty-generators', :group => :development

gem 'rspec-rails', '2.6.1.beta1', :group => [:development, :test]
gem 'faker', '0.3.1', :group => [:development, :test]
gem 'rspec', '2.6', :group => [:test, :development]
gem 'populator', :group => [:development, :test]

#gem 'ruby-debug19', :require => 'ruby-debug', :group => [:development, :test]

gem "factory_girl_rails", ">= 1.1.0", :group => :test
gem "cucumber-rails", ">= 1.0.2", :group => :test
gem "pickle", ">=0.4.10", :group => :test
gem "capybara", ">= 1.0.1", :group => :test
gem "database_cleaner", ">= 0.6.7", :group => :test
gem "launchy", ">= 2.0.5", :group => :test
gem "email_spec", :group => :test
gem 'guard-rspec', :group => :test
gem "mocha", :group => :test

这是堆栈跟踪:

➜  taskfree git:(master) ✗ bundle exec rails server -e production
=> Booting WEBrick
=> Rails 3.2.1 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport- 3.2.1/lib/active_support/dependencies.rb:317:in `rescue in depend_on': No such file to load -- ruby-debug (LoadError)
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport3.2.1/lib/active_support/dependencies.rb:312:in `depend_on'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:225:in `require_dependency'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/engine.rb:438:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/engine.rb:438:in `block in eager_load!'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/engine.rb:436:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/engine.rb:436:in `eager_load!'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/bidhan/code/taskfree/config/environment.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /Users/bidhan/code/taskfree/config.ru:4:in `block in <main>'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /Users/bidhan/code/taskfree/config.ru:1:in `new'
from /Users/bidhan/code/taskfree/config.ru:1:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands/server.rb:46:in `app'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands/server.rb:70:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands.rb:55:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

这是我刚刚在开发模式下启动服务器时的输出:

➜  taskfree git:(master) ✗ bundle exec rails server              
=> Booting WEBrick
=> Rails 3.2.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-02-17 15:09:24] INFO WEBrick 1.3.1
[2012-02-17 15:09:24] INFO ruby 1.9.2 (2011-07-09) [x86_64-darwin10.5.0]
[2012-02-17 15:09:24] INFO WEBrick::HTTPServer#start: pid=33798 port=3000

最佳答案

您的 Gemfile.lock 可以帮助您追踪哪个 gem 有 ruby​​-debug 作为依赖项。打开它并搜索“ruby-debug”,它应该嵌套在依赖于它的 gem 下方。

也就是说,我确实注意到一个问题可能会让您感到悲伤。 aws-s3 gem 和 aws-sdk gem 不兼容。它们都使用 AWS::S3 常量,一个作为模块,另一个作为类。根据所需的顺序,您会得到不同的行为。

Paperclip 最近将 aws-s3 作为依赖项替换为 aws-sdk。您应该能够简单地从 Gemfile 中删除 aws-s3(除非您专门在回形针之外使用 aws-s3)。如果您在回形针之外依赖 aws-s3,您将需要使用 aws-sdk 将这些调用替换为等效调用。

关于ruby-on-rails-3 - 在生产模式下,我收到 - No such file to load -- ruby​​-debug (LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9334831/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com