[英]Rails server command not functioning ubuntu 10.04
I have installed rvm ruby 1.9.3 and rails 3.0.5, and am trying right now to enter the "rails server" command line but this is what I get: 我已经安装了rvm ruby 1.9.3和rails 3.0.5,现在正在尝试输入“ rails server”命令行,但这是我得到的:
badr@Badoo:~/rails_projects/first_app$ rails s
/home/badr/rails_projects/first_app/config/application.rb:7:in `<top (required)>': undefined method `groups' for Rails:Module (NoMethodError)
from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p429/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have been following this tutorial . 我一直在关注本教程 。 I'm using ubuntu 12.04 lts and I guess I don't need to tell you that I'm a newbie... 我正在使用ubuntu 12.04 lts,我想不需要告诉你我是新手...
I really don't know what's wrong (railties gem? the rvm?), I've been googling for a solution the whole day. 我真的不知道出什么问题了(raillet gem?rvm?),我整天都在寻找解决方案。
Thanks in advance 提前致谢
First. 第一。 update your rails to the current stable version 3.2.13 and see if the error is gone (It will be) also update your ruby to 2 将您的rails更新到当前的稳定版本3.2.13,看看错误是否消失了(它将是)还将ruby更新为2
else: 其他:
See if this works: 查看是否可行:
https://stackoverflow.com/a/13275655/1379394 https://stackoverflow.com/a/13275655/1379394
In config/application.rb
substitute 在config/application.rb
替代
if defined?(Bundler)
Bundler.require(*Rails.groups(:assets => %w(development test)))
end
With 用
Bundler.require(:default, Rails.env) if defined?(Bundler)
And another question. 还有一个问题。 why are you using rails 3.0.5? 为什么要使用Rails 3.0.5? 3.2.13 released Mar 18, 2013 2013年3月18日发布3.2.13
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.