-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not find command activerecord #9
Comments
Somebody else was having this problem, and I just realized how to debug it. Looking at it now |
Ok, I just released a Make sure to update the version of the base This fix will only work for rubygems, not any other gem package managers. I wanted to get something out there, but if you use something else let me know and we can see if we can find a solution. Last, when you run the command you're likely to get the following message:
I'm not sure why that's outputting, but I'll look at it later. Thanks! Let me know if that worked for you |
Thanks for looking at it. The specification warning note comes from here: https://github.com/rubygems/rubygems/blob/master/lib/rubygems/specification.rb#L820 When I run the command now I get the warning message followed by this: WARN: Unresolved specs during Gem::Specification.reset:
minitest (~> 5.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Importing tables: [table list]
/Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday_middleware-0.9.1/lib/faraday_middleware.rb:25:in `block in <module:FaradayMiddleware>': cannot load such file -- faraday_middleware/request/encode_json (LoadError)
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday.rb:215:in `call'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday.rb:215:in `block in load_middleware'
from /Users/harry/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday.rb:197:in `middleware_mutex'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday.rb:214:in `load_middleware'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday.rb:188:in `lookup_middleware'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:203:in `use_symbol'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:92:in `request'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4j-core-4.0.1/lib/neo4j-server/cypher_session.rb:30:in `block in create_connection'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday/connection.rb:91:in `initialize'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday.rb:70:in `new'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/faraday-0.9.1/lib/faraday.rb:70:in `new'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4j-core-4.0.1/lib/neo4j-server/cypher_session.rb:28:in `create_connection'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4j-core-4.0.1/lib/neo4j-server/cypher_session.rb:48:in `open'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4j-core-4.0.1/lib/neo4j-server/cypher_session.rb:5:in `block in <module:Server>'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4j-core-4.0.1/lib/neo4j/session.rb:111:in `call'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4j-core-4.0.1/lib/neo4j/session.rb:111:in `create_session'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4j-core-4.0.1/lib/neo4j/session.rb:98:in `open'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4apis-activerecord-0.6.1/lib/neo4apis/cli/activerecord.rb:94:in `neo4apis_client'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4apis-activerecord-0.6.1/lib/neo4apis/cli/activerecord.rb:66:in `import_models_or_tables'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4apis-activerecord-0.6.1/lib/neo4apis/cli/activerecord.rb:52:in `all_models'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor/invocation.rb:115:in `invoke'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor.rb:235:in `block in subcommand'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/gems/neo4apis-0.5.1/bin/neo4apis:14:in `<top (required)>'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/bin/neo4apis:23:in `load'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/bin/neo4apis:23:in `<main>'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/bin/ruby_executable_hooks:15:in `eval'
from /Users/harry/.rvm/gems/ruby-2.2.0@dealerdbsql/bin/ruby_executable_hooks:15:in `<main>' |
Interesting, it looks like you ran the |
Correct. Rails 4.2 app.
|
Oh, right, forgot to ask: What port is your neo4j server running on? If it's something other than 7474 than you need to use the I doubt that's it though... @subvertallchris Could you have a look since you've worked with Faraday more than me (and it's way past my bedtime ;)? The last line in our world is this: https://github.com/neo4jrb/neo4j-core/blob/master/lib/neo4j-server/cypher_session.rb#L30 |
If it helps, here's the Gemfile.lock
|
I use the default 7474 as the neo4j port. |
I'm looking, but I can't quite figure it out. It seems to be something in the faraday_middleware gem, but as far as I can see it should work fine. I'm also testing it and it's working for me. How many tables were in that table list, BTW? Did you add |
There are about 20 tables. I installed the gem via RubyGems. Trying again with the gem in my Gemfile, I get a new error.
|
I also tried importing a single model which references another model. Here are the migrations: class CreateCompanies < ActiveRecord::Migration
def change
create_table :companies do |t|
t.string :name
t.timestamps
end
end
end class CreateDealers < ActiveRecord::Migration
def change
create_table :dealers do |t|
t.references :company, index: true
t.integer :rank, default: 1
t.timestamps
end
end
end And then I ran this command from the terminal: The result was this:
|
First off, thanks for your help! This is really useful. There errors are looking more tractable! I'm looking deeper, but I have a couple of questions first: Can you share the model (or a stripped down version) of the one from your app when you just tried to import one? For the second thing that you tried, do you also have ActiveRecord models for the dealers/companies tables? If not, then neo4apis-activerecord is probably trying to generate models, but it's not generating one for I actually need to sit down and fix that. Right now on the command like if you specify models or tables, it actually (mostly) does the same thing and lets you specify either models or tables and it uses the ActiveSupport#Inflectors module to get what it needs. I should be more strict about that because if you haven't defined a model is your ruby application, it shouldn't try to generate one. |
Is I don't think I'll be able to fix it tonight and I'll be busy this weekend, but I'll take another look again soon. Thanks! |
Yes, |
Also, I appreciate your help with this, but please don't drop everything to fix my problem. I have other ways of getting the data into Neo4j and was really just interested in seeing what the results were when I tried your gem. That said, I'm happy to continue debugging if you'd like to explore some more. |
Ah! Sorry, I didn't see when you tagged me cause it was the day I was out and about. The |
Ok, back to this, and sorry for the lack of response ;) I've made a number of improvements, most of which probably won't help. But I've also added a Thanks! |
Using version 0.6.0. |
Executing
neo4apis activerecord --help
from the terminal on Mac 10.10.1 results in message "Could not find command activerecord"neo4apis-activerecord gem installed with RVM.
The text was updated successfully, but these errors were encountered: