我正在努力让自己继续从事开源项目:KiungoWiki
几个月前,我可以简单地启动数据库
mongod
启动服务器
$ rails s
并转到 localhost:3000 以查看一切正常运行。
现在,由于某种原因,情况发生了变化。我仍然可以启动数据库:
$ mongod
mongod --help for help and startup options
Fri Apr 13 15:09:45 MongoDB starting : pid=2803 port=27017 dbpath=/data/db/ 64-bit
Fri Apr 13 15:09:45 db version v1.6.5, pdfile version 4.5
Fri Apr 13 15:09:45 git version: 0eb017e9b2828155a67c5612183337b89e12e291
Fri Apr 13 15:09:45 sys info: Linux domU-12-31-39-06-79-A1 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
Fri Apr 13 15:09:45 [initandlisten] waiting for connections on port 27017
Fri Apr 13 15:09:45 [websvr] web admin interface listening on port 28017
但是当我尝试启动服务器时,会发生奇怪的事情:
$ rails s
Invalid gemspec in [/var/lib/gems/1.8/specifications/mongo-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55abbd6c78> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/libv8-3.3.10.4-x86_64-linux.gemspec]: invalid date format in specification: "2011-11-15 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/bson_ext-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55ab9b6d08> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-1.0.19.gemspec]: invalid date format in specification: "2011-11-26 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/factory_girl_rails-1.7.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55aba7e290> 3.0.7"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/orm_adapter-0.0.6.gemspec]: invalid date format in specification: "2012-01-10 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mongo-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55abbd6c78> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/libv8-3.3.10.4-x86_64-linux.gemspec]: invalid date format in specification: "2011-11-15 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/bson_ext-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55ab9b6d08> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-1.0.19.gemspec]: invalid date format in specification: "2011-11-26 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/factory_girl_rails-1.7.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55aba7e290> 3.0.7"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/orm_adapter-0.0.6.gemspec]: invalid date format in specification: "2012-01-10 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mongo-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55abbd6c78> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/libv8-3.3.10.4-x86_64-linux.gemspec]: invalid date format in specification: "2011-11-15 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/bson_ext-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55ab9b6d08> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-1.0.19.gemspec]: invalid date format in specification: "2011-11-26 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/factory_girl_rails-1.7.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55aba7e290> 3.0.7"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/orm_adapter-0.0.6.gemspec]: invalid date format in specification: "2012-01-10 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mongo-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55abbd6c78> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/libv8-3.3.10.4-x86_64-linux.gemspec]: invalid date format in specification: "2011-11-15 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/bson_ext-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55ab9b6d08> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-1.0.19.gemspec]: invalid date format in specification: "2011-11-26 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/factory_girl_rails-1.7.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55aba7e290> 3.0.7"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/orm_adapter-0.0.6.gemspec]: invalid date format in specification: "2012-01-10 00:00:00.000000000Z"
Could not find tilt-1.3.3 in any of the sources
Run `bundle install` to install missing gems.
我已经尝试了错误消息提示的所有方法,但均无济于事。现在,我想开始了解问题的真正含义。有什么帮助吗?
顺便说一句:我正在尝试使用来自 github 的最新代码,它非常适合项目中的其他开发人员。
更新 我尝试运行
gem update --system
但得到以下结果:
Invalid gemspec in [/var/lib/gems/1.8/specifications/mongo-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55abbd6c78> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/libv8-3.3.10.4-x86_64-linux.gemspec]: invalid date format in specification: "2011-11-15 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/bson_ext-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55ab9b6d08> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-1.0.19.gemspec]: invalid date format in specification: "2011-11-26 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/factory_girl_rails-1.7.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55aba7e290> 3.0.7"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/orm_adapter-0.0.6.gemspec]: invalid date format in specification: "2012-01-10 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mongo-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55abbd6c78> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/libv8-3.3.10.4-x86_64-linux.gemspec]: invalid date format in specification: "2011-11-15 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/bson_ext-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55ab9b6d08> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-1.0.19.gemspec]: invalid date format in specification: "2011-11-26 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/factory_girl_rails-1.7.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55aba7e290> 3.0.7"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/orm_adapter-0.0.6.gemspec]: invalid date format in specification: "2012-01-10 00:00:00.000000000Z"
ERROR: gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package, and might break your Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.
If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian.
甚至gem --version
吐出错误
Invalid gemspec in [/var/lib/gems/1.8/specifications/mongo-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55abbd6c78> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/libv8-3.3.10.4-x86_64-linux.gemspec]: invalid date format in specification: "2011-11-15 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/bson_ext-1.6.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55ab9b6d08> 1.6.0"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/jquery-rails-1.0.19.gemspec]: invalid date format in specification: "2011-11-26 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/factory_girl_rails-1.7.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7f55aba7e290> 3.0.7"]
Invalid gemspec in [/var/lib/gems/1.8/specifications/orm_adapter-0.0.6.gemspec]: invalid date format in specification: "2012-01-10 00:00:00.000000000Z"
1.7.2
更新问题已更改
按照@Andreas 的建议,我删除了我的 gem 文件夹并重新安装了所有内容
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
rvm requirements
rvm reload
gedit .bashrc &
rvm reinstall 1.9.2
rvm gemset create rails3
rvm 1.9.2@rails3 gem update --system
rvm 1.9.2@rails3 gem install rails --version 3.1.1
cd Documents/Projets/KiungoWiki
bundle install
没有任何错误。mongod
工作正常,但rails s
说:
=> Booting WEBrick
=> Rails 3.1.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
DEPRECATION WARNING: Change Factory.define to FactoryGirl.define
Exiting
/home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/factory_girl-2.6.1/lib/factory_girl/syntax/default.rb:6:in `define': wrong number of arguments (1 for 0) (ArgumentError)
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/factory_girl-2.6.1/lib/factory_girl/deprecated.rb:5:in `method_missing'
from /home/shawn/Documents/Projets/KiungoWiki/spec/factories/albums.rb:3:in `<top (required)>'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in `load'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in `block in load'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in `load'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/factory_girl-2.6.1/lib/factory_girl/find_definitions.rb:20:in `block (2 levels) in find_definitions'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/factory_girl-2.6.1/lib/factory_girl/find_definitions.rb:19:in `each'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/factory_girl-2.6.1/lib/factory_girl/find_definitions.rb:19:in `block in find_definitions'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/factory_girl-2.6.1/lib/factory_girl/find_definitions.rb:15:in `each'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/factory_girl-2.6.1/lib/factory_girl/find_definitions.rb:15:in `find_definitions'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/factory_girl_rails-1.7.0/lib/factory_girl_rails/railtie.rb:26:in `block in <class:Railtie>'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:34:in `call'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/shawn/Documents/Projets/KiungoWiki/config/environment.rb:5:in `<top (required)>'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /home/shawn/Documents/Projets/KiungoWiki/config.ru:4:in `block in <main>'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
from /home/shawn/Documents/Projets/KiungoWiki/config.ru:1:in `new'
from /home/shawn/Documents/Projets/KiungoWiki/config.ru:1:in `<main>'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.3.6/lib/rack/builder.rb:40:in `eval'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.3.6/lib/rack/builder.rb:40:in `parse_file'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.3.6/lib/rack/server.rb:200:in `app'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/commands/server.rb:46:in `app'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.3.6/lib/rack/server.rb:301:in `wrapped_app'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/rack-1.3.6/lib/rack/server.rb:252:in `start'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in `start'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/commands.rb:54:in `block in <top (required)>'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap'
from /home/shawn/.rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.1/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'