Closed eltonfonseca closed 6 years ago
@eltonfonseca Does the following code works correctly?
require 'pycall'
NLTK = PyCall.import_module('nltk')
class RequerimentsController < ApplicationController
layout "admin"
def index
end
def show
end
def new
@requeriment = Requeriment.new
message = "Testando a integracao."
NTLK.word_tokenize(message)
end
end
BTW, please show the full messages by SEGV. Don't cut its fragment your own decision.
Hello @mrkn, I ran and gave the following error:
NameError at /requeriments/new
uninitialized constant RequerimentsController::NTLK
but I was able to solve the problem by typing the following code.
require 'pycall'
class RequerimentsController < ApplicationController
layout "admin"
def index
end
def show
end
def new
@requeriment = Requeriment.new
message = "Testando a integracao."
nltk = PyCall.import_module('nltk')
puts nltk.word_tokenize(message)
end
end
Thank you for your attention and for your help!
@eltonfonseca That's good!
Hello, how do I use pycall in rails 5.1?
I have the following controller in Rails:
When I raise the server with rails s, and I trigger the new action it gives the following error: