2012-04-22 5 views
0

this tutorial을 사용하려고 시도하지만 비 계 생성 코드에 문제가 있습니다.비계를 생성 할 수 없습니다

application.rb

this topic에서
Bundler.require(:default, Rails.env) if defined?(Bundler) 
#if defined?(Bundler) 
    # If you precompile assets before deploying to production, use this line 
    # Bundler.require(*Rails.groups(:assets => %w(development test))) 
    # If you want your assets lazily compiled in production, use this line 
    # Bundler.require(:default, :assets, Rails.env) 
#end 

테이크 솔루션,하지만 물론이 문제에 대한.

로그 :

C:\Users\Evgeny\Rails_projects\demo_app>rails generate scaffold User name:string 
email:string 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/ra 
iltie/configuration.rb:77:in `method_missing': undefined method `assets' for #<R 
ails::Application::Configuration:0x3a03248> (NoMethodError) 
     from C:/Users/Evgeny/Rails_projects/demo_app/config/application.rb:55:in 
`<class:Application>' 
     from C:/Users/Evgeny/Rails_projects/demo_app/config/application.rb:14:in 
`<module:DemoApp>' 
     from C:/Users/Evgeny/Rails_projects/demo_app/config/application.rb:13:in 
`<top (required)>' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.0.9 
/lib/rails/commands.rb:15:in `require' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.0.9 
/lib/rails/commands.rb:15:in `<top (required)>' 
     from script/rails:6:in `require' 
     from script/rails:6:in `<main>' 

구성 응용 프로그램 :

source 'http://rubygems.org' 

gem 'rails', '3.0.9' 
gem 'sqlite3', '1.3.3' 

답변

0

그것은 자산 뭔가. 적어도 레일 3.1을 업그레이드해야한다고 생각합니다. 3.2.3이 더 좋습니다.

마지막 버전의 레일즈 3.2.3으로 새로운 프로젝트를 생성하십시오.

또는이 솔루션 http://railscasts.com/episodes/282-upgrading-to-rails-3-1 또는 자습서 서 마지막 부분 http://russian.railstutorial.org/chapters/rails-3-1#top을 사용해보십시오.

업그레이드하지 않고 한 가지 더 해결할 수 있지만 확실하지 않습니다. config/application.rb에서 config.assets.enabled를 찾아서 false로 설정하십시오.

0

Rails 3.1 이상인 경우 Rails 자산 파이프 라인을 사용할 수 없습니다. 나는 C : /Users/Evgeny/Rails_projects/demo_app/config/application.rb의 55 행에서 추측하고 있는데, 문제를 일으키는 config.assets 행이있다. 해당 행을 제거하거나 Rails 3.1 또는 3.2로 업그레이드하십시오.

관련 문제