我想使用Neist4jrb将Rails应用程序部署到Capistrano生产。在部署期间,出现以下错误:
DEBUG [5a528d81] Finished in 0.057 seconds with exit status 0 (successful).
INFO [acd66fd5] Running /usr/local/bin/chruby-exec 2.3.0 -- bundle exec rake assets:precompile as deploy@46.101.153.252
DEBUG [acd66fd5] Command: cd /home/deploy/projects/larp-tool/releases/20160522103925 && ( export RAILS_ENV="production" ; /usr/local/bin/chruby-exec 2.3.0 -- bundle exec rake assets:precompile )
DEBUG [acd66fd5] rake aborted!
DEBUG [acd66fd5] Neo4j::Server::Resource::ServerException: Expected response code 200 Error for request http://localhost:7474/db/data/, 401
DEBUG [acd66fd5] /home/deploy/projects/larp-tool/shared/bundle/ruby/2.3.0/gems/neo4j-core-6.1.4/lib/neo4j-server/resource.rb:37:in `handle_response_error!'
/home/deploy/projects/larp-tool/shared/bundle/ruby/2.3.0/gems/neo4j-core-6.1.4/lib/neo4j-server/resource.rb:32:in `expect_response_code!'
/home/deploy/projects/larp-tool/shared/bundle/ruby/2.3.0/gems/neo4j-core-6.1.4/lib/neo4j-server/cypher_session.rb:86:in `initialize_resource'
...
我在neo4.yml
中设置了以下凭据:
production:
type: server_db
url: http://username:password@localhost:7474
并尝试过:
production:
type: server_db
url: http://localhost:7474
username: username
password: password
我使用Neo4j REST Api设置了这个凭据,当我在服务器上运行curl
时,一切似乎都很好:
curl http://username:password@localhost:7474/db/data/
那么,为什么在部署期间出现错误?
答案 0 :(得分:1)
您的return view('greetings', ['name' => 'Victoria']);
个文件对我来说都很合适。错误中的neo4j.yml
表示身份验证无效。有几种可能性:
401
任务在本地设置数据库,则可能没有达到此目的,因为他们在没有身份验证的情况下设置服务器以简化此过程。rake
环境变量设置为NEO4J_URL
以查看您获得的内容http://username:password@localhost:7474
没有意义)?