Ruby on Rails:Code Rot

时间:2013-07-16 22:56:59

标签: ruby-on-rails frameworks

长话短说,我启动了我的系统,当我告诉Rubymine进行开发时,我得到了这个。

/home/barnabus/.rvm/rubies/ruby-1.9.3-p385/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/barnabus/Projects/Ruby/houston/script/rails server -b 0.0.0.0 -p 3000 -e development
/home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:9:in `<module:MimeResponds>': /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:10: syntax error, unexpected tINTEGER, expecting keyword_end (SyntaxError)
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:6:in `<module:ActionController>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.8/lib/action_controller/metal/mime_responds.rb:5:in `<top (required)>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.8/lib/action_controller/base.rb:196:in `<class:Base>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.8/lib/action_controller/base.rb:171:in `<module:ActionController>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.8/lib/action_controller/base.rb:3:in `<top (required)>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/cancan-1.6.10/lib/cancan/controller_additions.rb:394:in `<top (required)>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/cancan-1.6.10/lib/cancan.rb:4:in `<top (required)>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:68:in `require'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:66:in `each'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:66:in `block in require'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:55:in `each'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler/runtime.rb:55:in `require'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/bundler-1.2.4/lib/bundler.rb:128:in `require'
from /home/barnabus/Projects/Ruby/houston/config/application.rb:7:in `<top (required)>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
from /home/barnabus/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
from /home/barnabus/Projects/Ruby/houston/script/rails:6:in `require'
from /home/barnabus/Projects/Ruby/houston/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1

我从未见过这个错误,我真的不知道在哪里以及如何进行,因为在框架代码中发生了很多这样的事情。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

诀窍是看到它是一个正在表现的宝石。所以我通过运行它去卸载了宝石。

bundle exec gem uninstall actionpack

它抱怨依赖。

You have requested to uninstall the gem:
actionpack-3.2.8
actionmailer-3.2.8 depends on [actionpack (= 3.2.8)]
railties-3.2.8 depends on [actionpack (= 3.2.8)]
rails-3.2.8 depends on [actionpack (= 3.2.8)]
rspec-rails-2.12.2 depends on [actionpack (>= 3.0)]
simple_form-2.0.4 depends on [actionpack (~> 3.0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  Y

但这并不重要,因为我们要重新安装它。

Successfully uninstalled actionpack-3.2.8
ERROR:  While executing gem ... (NoMethodError)
undefined method `delete' for #<Bundler::SpecSet:0x00000002c53b20>

在完成之后我不得不重新安装它,并且我只是运行

bundle install

我又回到了正轨。