It seems models are not loading since I get an 'uninitialized constant' 
error. The content of `./db/models` is: 

require_relative './db'

Sequel::Model.plugin :timestamps, update_on_create: true
Sequel::Model.plugin :prepared_statements
Sequel::Model.plugin :prepared_statements_safe
Sequel::Model.plugin :prepared_statements_associations


the content of `./db` is: 

require_relative './../.env'
require 'sequel'

# Delete DATABASE_URL from the environment, so it isn't accidently
# passed to subprocesses.  DATABASE_URL may contain passwords.
DB = Sequel.connect(ENV.delete('DATABASE_URL'))

The `.env.rb` file only contains the DB's URLs

Cheers,

On Tuesday, 21 June 2016 22:55:35 UTC-5, Jeremy Evans wrote:
>
> On Tuesday, June 21, 2016 at 8:51:45 PM UTC-7, René Maya wrote:
>>
>> Hi,
>>
>> I'm rather new at using sequel. I'm writing a sequel skeleton 
>> <https://github.com/renemaya/sequel_skeleton> so that I can easily add 
>> sequel with some extras via a Rakefile to my projects. It's based on 
>> Jeremy's roda-sequel-stack 
>> <https://github.com/jeremyevans/roda-sequel-stack> but I'm missing 
>> something because once I run `rake repl` I should be able to create new 
>> entries in the database but I'm not able to do it.
>>
>> the code in questions is
>>
>>
>> desc "Open REPL instance"
>> task :repl do
>>   if ENV['RACK_ENV'] == 'production'
>>     trap('INT', "IGNORE")
>>     sh "#{FileUtils::RUBY.sub('ruby', 'irb')} -r ./db/models"
>>   else
>>     trap('INT', "IGNORE")
>>     sh "#{FileUtils::RUBY.sub('ruby', 'pry')} -r ./db/models"
>>   end
>> end
>>
>
> Can you describe what problems you are having?  Is it crashing?  Is it not 
> loading the models? Is it not loading irb or pry?  What are the contents of 
> ./db/models.rb?
>
> Thanks,
> Jeremy 
>
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to