简体   繁体   English

NoMethodError(对于LinkedIn:Module,未定义的方法“新”)

[英]NoMethodError (undefined method `new' for LinkedIn:Module)

I'm just currently trying to follow tutorials to learn ruby and rails etc. So I apologise in advance for the newbie'ness of this question. 我目前正试图按照教程学习红宝石和铁轨等。因此,对于这个问题的新颖性,我事先表示歉意。

I've had a bunch of code dropped on me with instructions to 'get that up and see what it does'. 我身上放了很多代码,上面有说明“开始并看它能做什么”的说明。

Its a rails app that was up at one time and now needs to be resurrected. 它是一次启动的Rails应用程序,现在需要重新使用。 And I've been hammering at it for a week now. 我已经为此努力了一个星期。

So, I got the rails app extracted into a folder.. and used rvm to set myself up with 因此,我将Rails应用解压缩到一个文件夹中。并使用rvm设置了自己

  • ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux] 红宝石1.9.3p448(2013-06-27修订版41675)[i686-linux]
  • Rails 3.0.7 Rails 3.0.7
  • On ubuntu 12.04 在Ubuntu 12.04上

Cos I was told the app had been a 'rails 3' app. Cos被告知该应用程序是“ rails 3”应用程序。

I had to do a good bit of changing things in the Gemfile as gems were no longer available etc. Spent ages wrestling with Rake errors until I finally forced it back to 0.8.7 and got a db:migrate to work. 由于无法再使用宝石等,我不得不在Gemfile中做一些很大的更改。花了很多年的时间才因Rake错误而苦苦挣扎,直到我最终将其恢复为0.8.7并使db:migrate起作用。

And now I can get 'rails server' to startup WEBrick. 现在,我可以使用“ rails服务器”来启动WEBrick。 However when I point a browser at http://localhost:3000/ I get the output below. 但是,当我将浏览器指向http://localhost:3000/我得到下面的输出。

They thing I'm at a loss with is the "NoMethodError (undefined method `new' for LinkedIn:Module)" as I've grepped and I don't actually have a LinkeIn module in the code. 我不知所措的是“ NoMethodError(对于LinkedIn:Module,未定义的方法'new'的新方法)”,因为我grep了,但实际上在代码中没有LinkeIn模块。 I just have a Gemfile entry for the 我只有一个Gemfile条目

gem "linkedin", "~> 0.4.1" gem“ linkedin”,“〜> 0.4.1”

And I just can't find out where in the code this error is getting thrown from. 而且我只是无法确定此错误从何处引发。 If someone could help me identify what file/line that the error is emanating from .. or tell me that its actually coming from the LinkedIn gem than it would be a great help. 如果有人可以帮助我确定该错误是从哪个文件/行发出的,或者告诉我它实际上来自LinkedIn gem,那么它将大有帮助。

Its justkilling me that I can't find out where the code is so that I can go fix it. 我无法找到代码在哪里,这样我就可以解决它,这使我感到很震惊。 The Application Trace on the webpage is blank. 网页上的“应用程序跟踪”为空白。 To me it looks like its happening before the code gets to the controller specified for the root route in the routes.rb. 对我来说,这似乎是在代码到达routes.rb中为根路由指定的控制器之前发生的。

So, please, any help at all.. how to turn on tracing, where to go to find out whats going on at all.. 因此,请提供任何帮助..如何打开跟踪,去哪里查找到底发生了什么。

Thanks 谢谢

Vida 维达

*Console output on browse to root*

/home/ubuntu/.rvm/gems/ruby-1.9.3-p448/gems/rake-0.8.7/lib/rake/alt_system.rb:32: Use RbConfig instead of obsolete and deprecated Config.
=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-07-30 07:29:01] INFO  WEBrick 1.3.1
[2013-07-30 07:29:01] INFO  ruby 1.9.3 (2013-06-27) [i686-linux]
[2013-07-30 07:29:01] INFO  WEBrick::HTTPServer#start: pid=13793 port=3000


Started GET "/" for 127.0.0.1 at 2013-07-30 07:29:53 -0600

NoMethodError (undefined method `new' for LinkedIn:Module):


Rendered /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.1ms)
Rendered /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (4.3ms)
Rendered /home/ubuntu/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (9.0ms)

Just in case anyone else happens across this... Problem was solved with the help of an experienced Rails programmer. 以防万一其他人发生这种情况...在经验丰富的Rails程序员的帮助下解决了问题。 What he did was start from fresh and use rvm to straighten out some issues with my installation. 他所做的只是重新开始,并使用rvm来解决我的安装中的一些问题。

So, it wasn't a problem in code, per say, but an issue around installing rails etc. 因此,可以说,这不是代码中的问题,而是有关安装rails等的问题。

HTH someone. 有人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails NoMethodError(Hyperclient:Module 的未定义方法“新”) - Rails NoMethodError (undefined method `new' for Hyperclient:Module) 未定义的方法setup for Devise:Module(NoMethodError) - undefined method `setup' for Devise:Module (NoMethodError) Rails-NoMethodError-AccessToFinance:Module的未定义方法“作用域” - Rails - NoMethodError - undefined method 'scoped' for AccessToFinance:Module NoMethodError:未定义的方法“创建!” 付款方式:模块 - NoMethodError: undefined method `create!' for Payment:Module NoMethodError(JsonWebToken:Module的未定义方法“ encode”): - NoMethodError (undefined method `encode' for JsonWebToken:Module): NoMethodError(JsonWebToken:Module的未定义方法“ encode”) - NoMethodError (undefined method `encode' for JsonWebToken:Module) Twitter:Module的未定义方法“搜索”(NoMethodError) - undefined method `search' for Twitter:Module (NoMethodError) PaperTrail::VersionConcern:Module (NoMethodError) 的未定义方法“范围” - undefined method `scope' for PaperTrail::VersionConcern:Module (NoMethodError) NoMethodError:AjaxDatatablesRails:Module 的未定义方法“configure” - NoMethodError: undefined method `configure' for AjaxDatatablesRails:Module NoMethodError:Ckeditor :: Rails:Module的未定义方法“应用程序” - NoMethodError: undefined method `application' for Ckeditor::Rails:Module
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM