- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我是编程新手(以前只学过 html/css/design),想通过 Simply Rails 2 这本书开始学习 RoR。不过,我想从最新版本的 Ruby(1.9.2) 和 Rails ( 3)所以我被迫在没有这本书的情况下配置所有内容。我通过谷歌和 stackoverflow 看了很多。当我运行 rails server
时,它会自动使用 Webrick,但我想使用 Mongrel。我通过 gem install mongrel --pre
安装了预发布的 Mongrel 并删除了以前的版本。我读到为了让 Mongrel 与 rails server
一起工作,我不得不将 gem 'mongrel'
添加到 Gemfile,但我不知道我应该添加哪一个它到(我尝试了几次但没有改变)。所以我决定通过 git 查看 mongrel 文档并了解 mongrel_rails start
当我运行时我得到了这个:
C:\Ruby192\shovell>mongrel_rails start
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment... C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/runtime.rb:27:in
'block in setup': You have already activated mongrel 1.2.
0.pre2, but your Gemfile requires mongrel 1.1.5. Consider using bundle exec. (Gem::LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/spec_set.rb:12:in
'block in each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/spec_set.rb:12:in
'each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/spec_set.rb:12:in
'each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/runtime.rb:17:in
'setup'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler.rb:100:in
'setup'
from C:/Ruby192/shovell/config/boot.rb:8:in '<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from C:/Ruby192/shovell/config/application.rb:1:in '<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from C:/Ruby192/shovell/config/environment.rb:2:in '<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/rails.rb:147:in
'rails'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:116:in
'block (2 levels) in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in
'call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in
'listener'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:102:in
'block in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in
'call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in
'initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in
'new'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in
'run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/command.rb:210:in
'run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:282:in
'<top (required)>'
from C:/Ruby192/bin/mongrel_rails:19:in 'load'
from C:/Ruby192/bin/mongrel_rails:19:in '<main>'`
我最好的猜测是C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/runtime.rb:27:in
是关键,但我一直无法解决它。
'block in setup':您已经激活了 mongrel 1.2。
0.pre2,但您的 Gemfile 需要 mongrel 1.1.5。考虑使用 bundle exec。
我将不胜感激任何帮助,以便我可以继续实际学习语言!
编辑:感谢@duddle,我能够解决上述问题,但现在我遇到了另一个问题...我收到此错误:
C:\Ruby192\shovell>mongrel_rails start
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment... C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:239:in
'req uire': no such file to load -- dispatcher (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:239:in 'block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:225:in 'block in load_dependency'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:591:in 'new_constants_in'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:225:in 'load_dependency'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:239:in 'require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/rails.rb:148:in 'rails'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:116:in' block (2 levels) in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in 'call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in 'listener'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:102:in' block in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in 'call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in 'initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in 'new'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in'run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/command.rb:210:in 'run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:282:in '<top (required)>'
from C:/Ruby192/bin/mongrel_rails:19:in 'load'
from C:/Ruby192/bin/mongrel_rails:19:in '<main>
此时(凌晨 1 点......非常累)我最好的猜测是我丢失了一个文件或某些东西没有按应有的方式命名..也许我需要使用 :require
在我的 Gemfile 中执行操作……也许我只需要睡一觉。哈。
再次感谢 @duddle 让我克服了第一个错误!非常感谢任何更多帮助!
最佳答案
You have already activated mongrel 1.2. 0.pre2, but your Gemfile requires mongrel 1.1.5. Consider using bundle exec. is the key but I have not been able to solve it.
你快到了!
gem 'mongrel', '>= 1.2.0.pre2'
第二个参数告诉 bundler 需要等于或大于 1.2.0.pre2 的版本,在使用 Ruby 1.9.2 时必须使用它。
Bundler 页面提供了一个关于如何使用 Gemfile 的很好的引用:http://gembundler.com/gemfile.html
关于ruby - 使用 Rails3 和 Ruby 1.9.2 运行 Mongrel 时出现 LoadError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4020309/
我确实安装了下面提到的 ruby 东西 当我尝试执行 chef-client 时,我收到下面提到的错误 c:\RubyDevKit>chef-client C:/Ruby193/lib/ruby/
完整堆栈跟踪: /Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencie
我尝试使用 Ruby(在 Windows 下)连接到数据库。为此: 在 C:\Ruby193 安装 Ruby 安装 devkit (c:\ruby193\devkit)。运行“ruby dk.rb i
当我尝试在命令行中包含一个库时,我收到 LoadError 消息 $ ruby -v ruby 1.8.7 (2012-06-29 patchlevel 370) $ gem list | grep
这里的 Ruby 新手试图弄清楚如何使用 Gem,到目前为止,体验并不是很好。 在通过 gem 安装 mysql2 之后,我尝试在一个简单的文件中使用它。 require 'mysql2'#clien
我已经按照 https://github.com/cucumber/cucumber-rails#installation 在新的 Rails 4 应用程序中安装了 Cucumber-rails ge
在我的应用程序中;当我提交表单时,出现此错误: LoadError at /questions Unable to autoload constant Message, expected /app/m
似乎自动加载器正在加载 lib/tools/address 而不是我的模型 地址抛出以下错误 LoadError: Unable to autoload constant Address, expec
我想使用 smarter_csv gem,但是当我在代码中写入 require "smarter_csv" 时,它会给我以下错误消息: /System/Library/Frameworks/Ruby.
我刚开始使用 ruby,但在使用 bundle 时遇到困难。 bundle install 我的错误: /usr/local/lib/ruby/site_ruby/2.1.0/rubygems/c
在这个应用程序上一切正常,现在我在尝试推送到 Heroku 时得到了这个: Counting objects: 28, done. Delta compression using up to 4 th
我是 ruby 新手。我只是安装成功模块 libxml-ruby。当我运行一个需要“xml”的脚本时,它出现错误: C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core
我运行 pod install,但出现错误 LoadError - cannot load such file -- xcodeproj/prebuilt/x86_64-darwin12.5.0-2.
我正在尝试向我的 Xcode 项目添加一个 pod。我收到此错误: LoadError - no such file to load -- xcodeproj/prebuilt/universal-d
这个问题困扰了我几天...每当我使用 .bring_to_front 方法时 require "rubygems" require "watir" browser = Watir::Browser::
例如,当我需要一个文件(称为 st.rb)时: require 'rubygems' require 'mongrel' class TestHandler > require 'st.rb' Loa
我已经在 Ubuntu 上安装了 Julia 1.5.3,但 IJulia falis 带有 LoadError,如屏幕截图所示。 第一个conda环境的路径很不对,这个是在Ubuntu上跑的。 Pr
我在运行以下 Julia 代码片段时遇到错误 using GR, Interact t = 0:0.01:1 @manipulate for phi=0:0.1:6.28 plot(cos.(2
我无法运行 ruby Web 应用程序,并且收到以下消息错误: rackup webapp/config.ru --debug nil Exception `LoadError' at /usr/
我正在尝试按照本教程使用设计创建 token 身份验证: http://www.strukturedkaos.com/2011/09/19/soup-to-nuts-token-authenticat
我是一名优秀的程序员,十分优秀!