2013-06-03 14 views
38

ben Treehouse üzerinde Yakut öğretici takip ediyorum ve raylar sunucuyu başlatırken aşağıdaki hatayı almaya devam yazılabilir:Hata ne zaman raylar sunucu başlayan: uyarı: Güvensiz dünyayı PATH/usr dir, mod 040.777

/usr/local/rvm/gems/[email protected]/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777 
/usr/local/rvm/gems/[email protected]/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777 

sudo chmod ow/usr/local/ düzeltme ve diğer varyasyonlarla düzeltmeyi denedim, ancak ne yazık ki bu benim için bir şey yapmadı.

Sunucu yine de başlayacak olsa ve her şey iyi çalışıyor olsa da, şimdi bile bir çok hata alıyorum ve sunucu artık başlamayacak ve bir şekilde bağlanmış olabileceğini düşündüm. Bu düzeltme ile ilgili

Yass-Bents-MacBook-Pro:treebook yassine$ rails s 
/usr/local/rvm/gems/[email protected]/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777 
/usr/local/rvm/gems/[email protected]/gems/bundler-1.2.4/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777 
=> Booting WEBrick 
=> Rails 3.2.12 application starting in development on http://0.0.0.0:3000 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
Exiting 
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `load': /Users/yassine/treebook/app/models/user.rb:12: syntax error, unexpected keyword_end (SyntaxError) 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `block in load_file' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:639:in `new_constants_in' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:468:in `load_file' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:353:in `require_or_load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:502:in `load_missing_constant' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:192:in `block in const_missing' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in `const_missing' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:230:in `block in constantize' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `constantize' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:554:in `get' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:588:in `constantize' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise.rb:272:in `get' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise/mapping.rb:77:in `to' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise/mapping.rb:72:in `modules' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise/mapping.rb:89:in `routes' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise/mapping.rb:156:in `default_used_route' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise/mapping.rb:66:in `initialize' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise.rb:306:in `new' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise.rb:306:in `add_mapping' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise/rails/routes.rb:208:in `block in devise_for' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise/rails/routes.rb:207:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/devise-2.2.4/lib/devise/rails/routes.rb:207:in `devise_for' 
    from /Users/yassine/treebook/config/routes.rb:2:in `block in <top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:282:in `eval_block' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:260:in `draw' 
    from /Users/yassine/treebook/config/routes.rb:1:in `<top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `block in load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:245:in `load' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `block in load_paths' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:40:in `load_paths' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:16:in `reload!' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:26:in `block in updater' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/file_update_checker.rb:78:in `call' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/file_update_checker.rb:78:in `execute' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:27:in `updater' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializers' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing' 
    from /Users/yassine/treebook/config/environment.rb:5:in `<top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/yassine/treebook/config.ru:3:in `block in <main>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' 
    from /Users/yassine/treebook/config.ru:in `new' 
    from /Users/yassine/treebook/config.ru:in `<main>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:200:in `app' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/server.rb:46:in `app' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:254:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands/server.rb:70:in `start' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands.rb:55:in `block in <top (required)>' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap' 
    from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 
Yass-Bents-MacBook-Pro:treebook yassine$ 

Herhangi öneriler:

Bu hata şimdi olsun? Rails'i yeniden yüklemeyi denedim ama bu yardımcı olmadı, hala aynı hatalar.

Teşekkürler!

+2

nasıl uygulamanızı yapar /models/user.rb? –

+0

, beklenmedik bir anahtar kelime sonuna sahip, yani 'ruby -c app/models/FILENAME.rb' – AJcodez

cevap

38

bir -R (için yinelemeli) ile chmod deneyin: uyarıları Hakkında

chmod -R o-w /usr/local/ 
+6

ile model dosyalarınızın sözdizimini kontrol edin Teşekkürler, chmod komutları benim için çalışmadı, ama Disk Utility'deki disk izinleri ve bu düzeltildi. – user2448263

+1

Benim için de kullanılan disk araçlarını tamir ediyorum. Teşekkürler. :) – corysimmons

+0

@CorySimmons: OSX sürümünüzü vurgulayan zihin? (Benim durumumda (Snow Leopard veya Lion, hatanın içine düştüğümde işe yaramamıştı, hatırlayamıyordu.) –

14

:

... warning: Insecure world writable dir /usr in PATH, mode 040777 
... warning: Insecure world writable dir /usr in PATH, mode 040777 

Onlar size bildirdiklerini dizin /usr (ve /usr/local) dünya olduğunu yazılabilir. Düzeltmek için: chmod -R go-w /usr.

hata diyor ki:

... `load': /Users/yassine/treebook/app/models/user.rb:12: syntax error, unexpected keyword_end (SyntaxError) 

sizin user.rb dosyada hat 12 üzerinde fazladan end anahtar kelime var.

+1

Çok teşekkürler! Şimdi sunucuyu başlatabilirim, chmod komutları benim için çalışmadı, ancak Disk Utility'deki disk izinlerinin onarımını yaptım ve düzeltdim. User.rb dosyalarında diğer hatalara neden olan fazladan bir virgül vardı. – user2448263

+0

"chmod -R go-w/usr." Içindeki "git" nedir? –

+1

@AlexanderSupertramp 'go' grup ve diğerleri anlamına gelir, daha fazla ayrıntı için bkz. 'Adam 1 chmod'. – toro2k

132

seçeneği diski şebekeden "Disk İzinlerini Onar" deneyin

[DÜZENLE] OS X El Capitan için

:

sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume/

enter image description here

+13

Daha fazla UPVOTES GEREKSİNİMİZ! – Sheharyar

+4

Teşekkür ederim, bu OS X 10.9.3'e güncelledikten sonra kurulu bir yakut gemiyle benzer bir sorunu çözdü. – bayendor

+0

Sizinle karşılıyoruz :) –

İlgili konular