- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我正在运行 CentOS6 并从源代码安装了 Ruby,还有 Rails 和其他一些员工。
ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
rails -v
Rails 3.1.3
一些 gem :
*** LOCAL GEMS ***actionmailer (3.1.3, 2.3.14)actionpack (3.1.3, 2.3.14)activemodel (3.1.3)activerecord (3.1.3, 2.3.14)activeresource (3.1.3, 2.3.14)activesupport (3.1.3, 2.3.14)archive-tar-minitar (0.5.2)arel (2.2.1)bigdecimal (1.1.0)bouncy-castle-java (1.5.0146.1)builder (3.0.0)bundler (1.0.21)coderay (0.9.7)columnize (0.3.5)edavis10-object_daddy (0.4.3)erubis (2.7.0)fastercsv (1.5.0)ffi (1.0.11)hike (1.2.1)hoe (2.12.4)i18n (0.6.0, 0.4.2)io-console (0.3)jruby-openssl (0.7.4)json (1.5.4)linecache19 (0.5.13)mail (2.3.0)metaclass (0.0.1)mime-types (1.17.2)minitest (2.5.1)mocha (0.10.0)multi_json (1.0.4)mysql (2.8.1)mysql2 (0.3.11, 0.2.7)net-ldap (0.2.2)polyglot (0.3.3)rack (1.3.5, 1.1.2)rack-cache (1.1)rack-mount (0.8.3)rack-ssl (1.3.2)rack-test (0.6.1)rails (3.1.3, 2.3.14)railties (3.1.3)rake (0.9.2.2)rdoc (3.9.4)rmagick (2.13.1)ruby-debug-base19 (0.11.26, 0.11.25)ruby-debug19 (0.11.6)ruby-mysql (2.9.4)ruby-openid (2.1.4)ruby_core_source (0.1.5)rubygems-update (1.8.12)rubytree (0.5.2)shoulda (2.11.3, 2.10.3)sprockets (2.0.3)sqlite3 (1.3.5, 0.1.1)sqlite3-ruby (1.3.3, 1.2.5)thor (0.14.6)tilt (1.3.3)treetop (1.4.10)tzinfo (0.3.31)
I need Rails in order to run chiliproject
, but when running the following command
RAILS_ENV=production bundle exec rake db:migrate
我得到:
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.rake aborted!cannot load such file -- mysqlTasks: TOP => db:migrate => environment(See full trace by running task with --trace)
Now with --trace
:
RAILS_ENV=production bundle exec rake db:migrate --trace >> tmp/rake** Invoke db:migrate (first_time)** Invoke environment (first_time)** Execute environment!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.rake aborted!cannot load such file -- mysql/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in `require'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in `require'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/core_ext/kernel/requires.rb:7:in `block in require_library_or_gem'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/core_ext/kernel/requires.rb:5:in `require_library_or_gem'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/mysql_adapter.rb:61:in `mysql_connection'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `block in checkout'/usr/local/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'/var/www/html/chiliproject/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:218:in `quoted_left_column_name'/var/www/html/chiliproject/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:94:in `acts_as_nested_set'/var/www/html/chiliproject/app/models/issue.rb:33:in `'/var/www/html/chiliproject/app/models/issue.rb:15:in `'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in `require'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in `require'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:291:in `require_or_load'/var/www/html/chiliproject/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb:133:in `require_or_load_with_engine_additions'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:451:in `load_missing_constant'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing_with_dependencies'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/inflector.rb:375:in `const_get'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/inflector.rb:375:in `block in constantize'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/inflector.rb:374:in `each'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/inflector.rb:374:in `constantize'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/observer.rb:157:in `observed_class'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/observer.rb:183:in `observed_classes'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/observer.rb:166:in `initialize'/usr/local/lib/ruby/1.9.1/singleton.rb:141:in `new'/usr/local/lib/ruby/1.9.1/singleton.rb:141:in `block in instance':10:in `synchronize'/usr/local/lib/ruby/1.9.1/singleton.rb:139:in `instance'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/observer.rb:38:in `block in instantiate_observers'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/observer.rb:36:in `each'/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.14/lib/active_record/observer.rb:36:in `instantiate_observers'/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:15:in `block in define_dispatcher_callbacks'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:182:in `call'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:182:in `evaluate_method'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:166:in `call'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:90:in `block in run'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:90:in `each'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:90:in `run'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:276:in `run_callbacks'/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:51:in `run_prepare_callbacks'/usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/initializer.rb:631:in `prepare_dispatcher'/usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/initializer.rb:185:in `process'/usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/initializer.rb:113:in `run'/var/www/html/chiliproject/config/environment.rb:39:in `'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `block in require'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'/usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/tasks/misc.rake:4:in `block in '/usr/local/lib/ruby/1.9.1/rake/task.rb:205:in `call'/usr/local/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'/usr/local/lib/ruby/1.9.1/rake/task.rb:200:in `each'/usr/local/lib/ruby/1.9.1/rake/task.rb:200:in `execute'/usr/local/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'/usr/local/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'/usr/local/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'/usr/local/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites'/usr/local/lib/ruby/1.9.1/rake/task.rb:174:in `each'/usr/local/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites'/usr/local/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain'/usr/local/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'/usr/local/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'/usr/local/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'/usr/local/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'/usr/local/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level'/usr/local/lib/ruby/1.9.1/rake/application.rb:94:in `each'/usr/local/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'/usr/local/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'/usr/local/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'/usr/local/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'/usr/local/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'/usr/local/lib/ruby/1.9.1/rake/application.rb:63:in `run'/usr/local/bin/rake:32:in `'Tasks: TOP => db:migrate => environment
Does anyone knows what's wrong with mysql gem files?
I also tried to install mysql gem files like this
gem install ruby-mysql2 --no-rdoc --no-ri -- --with-mysql-config=/usr/bin/mysql_config
最佳答案
我只是遇到了类似的问题,你可能正在做我曾经做过的事情:我正在使用“gem list”来确定安装了什么(它列出了 *** LOCAL GEMS ***
就像你显示)并且我看到了 mysql
,但是我的项目的 Gemfile
不需要 bundler
来安装 mysql
。
如果您只键入 bundle show
,它会列出“mysql”吗?如果不是,则 chiliproject
中的 Gemfile
不会导致 bundler
安装 mysql
。我发现这一切都非常困惑,直到我意识到我混淆了管理安装的 gem 的不同方法。
如果您或来此的其他人遇到同样的问题,那么这也许会有所帮助。 (也许这种糟糕的解释会鼓励一位 Rails 专家为我们详细说明。)
换句话说,您本地安装的 gem 列表与您应用的 bundle gem 中安装的列表不同(因此 bundler 的名称
工具来自)。当您运行您的应用程序并使用 bundler
管理其依赖项时,您必须在 bundler
范围内执行所有操作,以确保它们一起工作。当你这样做时,它实际上非常简单,并为你解决了很多问题,但如果你以前没有使用 bundler
的应用程序经验,那么它只需要一点时间就可以使用到。
关于ruby-on-rails - Rails、Ruby 1.9.3p0 和 mysql gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8453859/
以下是一个非常简单的ruby服务器。 require 'socket' local_socket = Socket.new(:INET, :STREAM) local_addr = Socket.
我正在使用 OS X(使用 bash),并且是 unix 的新手。我想知道是否可以修改一些文件以便运行 ruby 程序,我不需要“ruby file.rb”,而是可以运行“ruby.rb”。 有理
我在用 Ruby 替换字符串时遇到一些问题。 我的原文:人之所为不如兽之所为。 我想替换为:==What== human does is not like ==what== animal does.
我想在一个循环中从 Ruby 脚本做这样的事情: 写一个文件a.rb(每次迭代都会改变) 执行系统(ruby 'a.rb') a.rb 将带有结果的字符串写入文件“results” a.rb 完成并且
我的问题是尝试创建一个本地服务器,以便我可以理解由我的新团队开发的应用程序。我的问题是我使用的是 Ruby 2.3.3,而 Gemfile 需要 2.3.1。我无法编辑 Gemfile,因为我被告知很
我有一个使用 GLI 框架用 Ruby 编写的命令行实用程序。我想在我的主目录中配置我的命令行实用程序,使用 Ruby 本身作为 DSL 来处理它(类似于 Gemfile 或 Rakefile)。 我
我的 Rails 应用 Controller 中有这段代码: def delete object = model.datamapper_class.first(:sourced_id =>
我正在寻找的解析器应该: 对 Ruby 解析友好, 规则设计优雅, 产生用户友好的解析错误, 用户文档的数量应该比计算器示例多, UPD:允许在编写语法时省略可选的空格。 快速解析不是一个重要的特性。
我刚开始使用 Ruby,听说有一种“Ruby 方式”编码。除了 Ruby on Rails 之外,还有哪些项目适合学习并被认可且设计良好? 最佳答案 Prawn被明确地创建为不仅是一个该死的好 PDF
我知道之前有人问过类似的问题,但是我该如何构建一个无需在前面输入“ruby”就可以在终端中运行的 Ruby 文件呢? 这里的最终目标是创建一个命令行工具包类型的东西。现在,为了执行我希望用户能够执行的
例如哈希a是{:name=>'mike',:age=>27,:gender=>'male'}哈希 b 是 {:name=>'mike'} 我想知道是否有更好的方法来判断 b 哈希是否在 a 哈希内,而
我是一名决定学习 Ruby 和 Ruby on Rails 的 ASP.NET MVC 开发人员。我已经有所了解并在 RoR 上创建了一个网站。在 ASP.NET MVC 上开发,我一直使用三层架构:
最近我看到 Gary Bernhardt 展示了他用来在 vim 中执行 Ruby 代码的 vim 快捷方式。捷径是 :map ,t :w\|:!ruby %. 似乎这个方法总是执行系统 Rub
在为 this question about Blue Ruby 选择的答案中,查克说: All of the current Ruby implementations are compiled to
我有一个 Ruby 数组 > list = Request.find_all_by_artist("Metallica").map(&:song) => ["Nothing else Matters"
我在四舍五入时遇到问题。我有一个 float ,我想将其四舍五入到小数点后的百分之一。但是,我只能使用 .round ,它基本上将它变成一个 int,意思是 2.34.round # => 2. 有没
我使用 ruby on rails 编写了一个小型 Web 应用程序,它的主要目的是上传、存储和显示来自 xml(文件最多几 MB)文件的结果。运行大约 2 个月后,我注意到 mongrel 进程
我们如何用 Ruby 转换像这样的字符串: 𝑙𝑎𝑡𝑜𝑟𝑟𝑒 收件人: Latorre 最佳答案 s = "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" => "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" s.u
通过 ruby monk 时,他们偶尔会从左侧字段中抛出一段语法不熟悉的代码: def compute(xyz) return nil unless xyz xyz.map {|a,
不确定我做错了什么,但我似乎弄错了。 问题是,给你一串空格分隔的数字,你必须返回最大和最小的数字。 注意:所有数字都是有效的 Int32,不需要验证它们。输入字符串中始终至少有一个数字。输出字符串必须
我是一名优秀的程序员,十分优秀!