前提・実現したいこと
railsにneo4jを導入したいです。
https://qiita.com/yudedako/items/072df2838b79162db5e7
このサイトの通りに実装しているのですが、途中のActiveNodeのところで次のようなエラーが出てしまいます。
¢ noglob bundle exec rake neo4j:migrate config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly: * development - set it to false * test - set it to false (unless you use a tool that preloads your test environment) * production - set it to true WARNING: `Faraday::Connection#basic_auth` is deprecated; it will be removed in version 2.0. While initializing your connection, use `#request(:basic_auth, ...)` instead. See https://lostisland.github.io/faraday/middleware/authentication for more usage info. rake aborted! Neo4j::Core::CypherSession::ConnectionFailedError: Connection failure: status: 500 /Users/name/.rbenv/versions/2.6.8/bin/bundle:23:in `load' /Users/name/.rbenv/versions/2.6.8/bin/bundle:23:in `<main>' Tasks: TOP => neo4j:migrate:all (See full trace by running task with --trace)
rakeの所はそのままだと上手くいかなかったので、
https://neo4jrb.readthedocs.io/en/latest/RakeTasks.html
これを参考にしてnoglobを使っています。
どのように変更すればいいのでしょうか。
現在のコード
application.rb
require_relative 'boot' require "rails" # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" # require "active_record/railtie" require 'neo4j/railtie' # require "active_storage/engine" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "action_cable/engine" require "sprockets/railtie" require "rails/test_unit/railtie" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module Task2 class Application < Rails::Application config.generators do |g| g.orm :neo4j end # Configure where to connect to the Neo4j DB # Note that embedded db is only available for JRuby # config.neo4j.session.type = :http # config.neo4j.session.url = 'http://localhost:7474' # or # config.neo4j.session.type = :bolt # config.neo4j.session.url = 'bolt://localhost:7687' # or # config.neo4j.session.type = :embedded # config.neo4j.session.path = Rails.root.join('neo4j-db').to_s # Initialize configuration defaults for originally generated Rails version. config.neo4j.session.type = :http config.neo4j.session.url = 'http://tam:tirokiti@localhost:7474' config.neo4j.session.options = {faraday_options: { ssl: { verify: true }}} config.load_defaults 5.2 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. end end
Gemfile
source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.6.8' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.6' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of chromedriver to run system tests with Chrome gem 'chromedriver-helper' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'neo4j', '~> 9.6.0' gem 'neo4j-rake_tasks'
補足情報(FW/ツールのバージョンなど)
M1 Mac
Mac OS Big Sur 11.2.3
Ruby 2.6.8
Ruby on Rails 5.2.6
あなたの回答
tips
プレビュー