0

I created a new app in Rails using:

rails new myapp -m http://neo4jrb.io/neo4j/neo4j.rb -O

I did not executed the command:

rake neo4j:install[community-2.2.0,development]

since my database is already created, populated and hosted by an AWS server.

How I can set my Rails dev env to use the database on the AWS server?

When running the command from my local computer myapp folder

$ rails s -d

I am getting the error:

Expected response code 200 Error for request http://my-aws-server.com:7474/db/data/, 401, 401 (Neo4j::Server::Resource::ServerException)

Christophe Willemsen
  • 19,399
  • 2
  • 29
  • 36
LDB
  • 692
  • 6
  • 18

1 Answers1

0

I added these three lines in the file config/environments/development.rb:

  config.neo4j.session_options = { basic_auth: { username: 'neo4j_user', password: 'neo4j_pass'} }
  config.neo4j.session_type = :server_db
  config.neo4j.session_path = 'http://my-aws-server.com:7474'

Problem solved.

LDB
  • 692
  • 6
  • 18
  • 1
    This is also documented at https://github.com/neo4jrb/neo4j/wiki/Neo4j-v3-Setup#usage-with-a-remote-server. – subvertallchris Apr 15 '15 at 23:56
  • Correct, but for the reason that I want a db for dev and another one for test and another one for prod, I decided to apply the changes in the config/environments/development.rb instead of having a different application.rb file for each environment. – LDB Apr 16 '15 at 14:21