1
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
    Master:blog shaunstanislaus$ bundle update
    Fetching gem metadata from https://rubygems.org/.........
    Fetching gem metadata from https://rubygems.org/..
    Enter your password to install the bundled RubyGems to your system: 
    Using rake (0.9.2.2) 
    Enter your password to install the bundled RubyGems to your system: 
    Using i18n (0.6.0) 
    Using multi_json (1.3.6) 
    Using activesupport (3.2.6) 
    Using builder (3.0.0) 
    Using activemodel (3.2.6) 
    Using erubis (2.7.0) 
    Using journey (1.0.4) 
    Using rack (1.4.1) 
    Using rack-cache (1.2) 
    Using rack-test (0.6.1) 
    Using hike (1.2.1) 
    Using tilt (1.3.3) 
    Using sprockets (2.1.3) 
    Using actionpack (3.2.6) 
    Using mime-types (1.19) 
    Using polyglot (0.3.3) 
    Using treetop (1.4.10) 
    Using mail (2.4.4) 
    Using actionmailer (3.2.6) 
    Using arel (3.0.2) 
    Using tzinfo (0.3.33) 
    Using activerecord (3.2.6) 
    Using activeresource (3.2.6) 
    Using bson (1.6.4) 
    Using bson_ext (1.6.4) 
    Using bundler (1.1.5) 
    Using coffee-script-source (1.3.3) 
    Using execjs (1.4.0) 
    Using coffee-script (2.2.0) 
    Using rack-ssl (1.3.2) 
    Using json (1.7.4) 
    Using rdoc (3.12) 
    Using thor (0.15.4) 
    Using railties (3.2.6) 
    Using coffee-rails (3.2.2) 
    Using jquery-rails (2.0.2) 
    Using mongo (1.0.9) 
    Using will_paginate (3.0.3) 
    Using mongoid (2.0.0.beta.19) 
    Using rails (3.2.6) 
    Using sass (3.1.20) 
    Using sass-rails (3.2.5) 
    Using sqlite3 (1.3.6) 
    Using uglifier (1.2.7) 
    Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is                         installed.
    Master:blog shaunstanislaus$ rails g mongoid:config
    /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configuration.rb:85:in

method_missing': undefined method/Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.19/lib/mongoid/railtie.rb:13の #
(NoMethodError)のジェネレーターは、/Library/Ruby/Gems/1.8/gems/ からmongoid-2.0.0.beta.19/lib/mongoid.rb:89:in require' from /Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.19/lib/mongoid.rb:89 from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in each' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in each' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5 /lib/bundler/runtime.rb:55:in require' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler.rb:119:in require' from /Users/shaunstanislaus/Desktop/code/blog/config/application.rb:7 from /Library/Ruby/Gems/1.8/gems/railties-3.2.6 /lib/rails/commands.rb:24:in require' from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24 from script/rails:6:inrequire' from script/rails:6

どうすればこれを修正できますか?

このコマンドを入力すると、上記のエラーが表示されます。

マスター:ブログ shaunstanislaus$ rails g mongoid:config

gemfile.loc bundle install rails g mongoid:config を削除しようとしましたが、このエラーが再び発生しました。まだ同じ。

Master:blog shaunstanislaus$ rails g mongoid:config

/Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in require': /Library/Ruby/Gems/1.8/gems/mongoid-3.0.3/lib/mongoid.rb:148: odd number list for Hash (SyntaxError) { to: Config })) ^ /Library/Ruby/Gems/1.8/gems/mongoid-3.0.3/lib/mongoid.rb:148: syntax error, unexpected ':', expecting '}' { to: Config })) ^ from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:inrequire' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/ bundler/runtime.rb:66: in each' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:inrequire' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55: in require' each' from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:infrom /Library/Ruby/Gems/ 1.8/gems/bundler-1.1.5/lib/bundler.rb:119:in require' from /Users/shaunstanislaus/Desktop/code/blog/config/application.rb:7 from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24:inrequire' from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24 from script /rails:6:スクリプトの「require」内/rails:6

4

3 に答える 3

0

これを入力して修正しましたbundle exec rails g mongoid:config

于 2012-09-05T22:05:07.027 に答える
0

GemFile.lock を削除し、bundle install を実行します。最新バージョンの Rails (3.2?) と Ruby (1.9.3-p###) で実行している場合は、動作するはずです。

Mongoid の「ジェネレーター」コマンドが表示されない理由は、使用しているレールとルビーのバージョンに対して gem が適切にインストールされなかった可能性が最も高いです。

これをチェックしてください:モンゴイドコマンドでRails gが失敗する… – Dominic Tancredi 2

于 2012-08-06T03:35:44.063 に答える
0

私はこれを設定しています

ルビー -v

ruby 1.9.3p194 (2012-04-20 リビジョン 35410) [x86_64-darwin12.0.0]

バンドル -v

バンドル バージョン 1.1.5

バンドルのインストールは成功します。rake サーバーでまだエラーが発生する

/Users/avaranovich/.gem/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:「必要」: /Users/avaranovich/.gem/gems/mongoid-3.0.4/lib/mongoid .rb:148: ハッシュの奇数リスト (SyntaxError) { to: Config }))

于 2012-08-22T08:44:30.257 に答える