万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・資産運用おすすめ
    10万円は1000円くらい利益
    資産運用ブログ アセマネ
    • ・寄付お願いします
      YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
      BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
      c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1
      Skycoin:KMqcn7x8REwwzMHPi9fV9fbNwdofYAWKRo

    Rails で MongoDB を使ってみた。

    参考:http://www.oiax.jp/rails/zakkan/rails_and_mongodb.html

    Rails 3.2.8でハマったところ

    config/initializers/mongoid.rb と config/database.mongo.yml は新規作成

    RAILS_ROOT → Rails.root.to_s

    RAILS_ENV → Rails.env

    config/environment.rb
    Rails::Initializer.runがなくなってる?



    でもよくわからないのでこっちにした。

    http://robertbialek.wordpress.com/2011/06/21/getting-rails-3-1-mongodb-and-scaffold-generators-to-work/

    rake test でエラー

    undefined method `groups’ for Rails:Module

    これはコメントアウトするべきなのかな?
    Bundler.require(*Rails.groups(:assets => %w(development test))) を外した

    ・config/application.rb

     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)