ruby on rails模型创建错误

时间:2014-01-25 11:20:40

标签: ruby-on-rails mysql2


我是红宝石的新手。 当我创建模型时,它会给出以下错误。请解决此问题。

noexec.rb:75:in `block in setup': undefined method `name' for ["hike-1.2.3", #<Gem::Specification name=hike version=1.2.3>]:Array (NoMethodError)

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `each'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `map'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `setup'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:114:in `check'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:121:in `<top (required)>'

from /home/rajesh/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:33:in `require'

from /home/rajesh/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:33:in `rescue in require'

from /home/rajesh/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:29:in `require'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/rubygems-bundler-1.4.2/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:50:in `call'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:50:in `block in run'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:49:in `each'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:49:in `run'

from /home/rajesh/.rvm/gems/ruby-1.9.3-p484@global/bin/ruby_executable_hooks:10:in `<main>'

1 个答案:

答案 0 :(得分:0)

我假设您正在使用此https://github.com/sstephenson/hike

从项目中删除它并重新开始 - 如果模型被创建,则问题出现在hike gem中,

然后尝试不同版本的gem,如果有类似的报告问题,请参阅https://github.com/sstephenson/hike