2011-12-20 7 views
2

Mac OSX上でRuby on neilsでneo4jを使用しようとしています。 jrubyとneo4jをbrewでインストールしました。 http://wiki.neo4j.org/content/Getting_Started_With_Ruby と、この: 私は、このガイドの後https://github.com/andreasronge/neo4j は、まず、私のサーバーのNeo4jが起動し、私はノードとの関係を作成することができました。Jrubyプロジェクトレール付きNeo4j

私はRVM(ree install jruby @ neo4j)で新しいgemsetを作成しました。 第2に、テストの最初のガイドが成功しました。

私はコマンドの第2のガイドで新しいプロジェクトを作成しました。 プロジェクトが作成され、バンドルが成功しました。 しかし、私はそれが私を与えた(rails s)サーバーを起動するために行ったとき:

NameError: uninitialized constant Neo4j::Rails::Application 
    const_missing at org/jruby/RubyModule.java:2590 
      Neo4j at /Users/guillaumelegendre/dev/boosket/neo4j/config/application.rb:19 
     (root) at /Users/guillaumelegendre/dev/boosket/neo4j/config/application.rb:18 
     require at org/jruby/RubyKernel.java:1038 
     (root) at /Users/guillaumelegendre/dev/boosket/neo4j/config/application.rb:52 
      tap at org/jruby/RubyKernel.java:1804 
     (root) at /Users/guillaumelegendre/.rvm/gems/[email protected]/gems/railties-3.1.3/lib/rails/commands.rb:49 
     require at org/jruby/RubyKernel.java:1038 
     (root) at script/rails:6 

私はGoogleで検索、私は同じエラーで誰を見つけるdid't。

そして、これが私のapplication.rbだったが、これが第二スクリプトのガイドに属するapplication.rbですが:

require File.expand_path('../boot', __FILE__) 

require 'action_controller/railtie' 
require 'action_mailer/railtie' 
require 'active_resource/railtie' 
require 'rails/test_unit/railtie' 
require 'will_paginate/railtie' 
require 'neo4j' 


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 

module Neo4j 
    class Application < Rails::Application 
    # Settings in config/environments/* take precedence over those specified here. 
    # Application configuration should go into files in config/initializers 
    # -- all .rb files in that directory are automatically loaded. 

    # Custom directories with classes and modules you want to be autoloadable. 
    # config.autoload_paths += %W(#{config.root}/extras) 

    # Only load the plugins named here, in the order given (default is alphabetical). 
    # :all can be used as a placeholder for all plugins not explicitly named. 
    # config.plugins = [ :exception_notification, :ssl_requirement, :all ] 

    # Activate observers that should always be running. 
    # config.active_record.observers = :cacher, :garbage_collector, :forum_observer 

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 
    # config.time_zone = 'Central Time (US & Canada)' 

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 
    # config.i18n.default_locale = :de 

    # Configure the default encoding used in templates for Ruby 1.9. 
    config.encoding = "utf-8" 

    # Configure sensitive parameters which will be filtered from the log file. 
    config.filter_parameters += [:password] 

    # Enable Neo4j generators, e.g: rails generate model Admin --parent User 
    config.generators do |g| 
     g.orm    :neo4j 
     g.test_framework :rspec, :fixture => false 
    end 

    # Configure where the neo4j database should exist 
    config.neo4j.storage_path = "#{config.root}/db/neo4j-#{Rails.env}" 


    # Enable the asset pipeline 
    config.assets.enabled = true 

    # Version of your assets, change this if you want to expire all your assets 
    config.assets.version = '1.0' 
    end 
end 

答えて

1

奇妙な、あなたはレール、JRubyとのNeo4jのバージョンを使用していますか? これは、箱から出して動作するはずです:

gem install rails 
rails new myapp -m http://andreasronge.github.com/rails3.rb 
cd myapp 
bundle 
rails generate scaffold User name:string email:string 
rails s 
open a webbrowser: http://localhost:3000/users 

どのように私はこの問題を再現することができますか?

+0

私はJRubyの1.6.3 のNeo4jコミュニティ-1.5 レール3.1.3 を使用し、私がしようとした場合:文字列電子メール::文字列 Serverは私に同じエラーに答える レールは、足場のユーザー名を生成します。 最後にインストールするときにエラーは発生していません。しかし、あなたが理由を見ないなら、私はきれいにすべてを再インストールしようとします。そして私は結果をあなたにお届けします。 私はあなたの興味に感謝します。 – Guillaume

+0

neo4jをインストールしないでください!これは組み込みデータベースであり、neo4jの宝石にはすべてが含まれています。どのバージョンの宝石を使用しますか?また、最新のjruby 1.6.5を使用する必要があります:ruby -vあなたに教えてください(あなたが本当にjrubyにいることを確認するだけです) –

+0

私はjruby 1.6.3です。明らかに私は1.6.5を使うためにrvmを設定する必要がありますルビ1.8.3の1.6.3とは逆のことを正しく理解すれば、ルビ1.9です。それが重要かどうかわかりません。 – Guillaume