Join GitHub today
Error running "padrino g admin" #881
I've created a new Padrino project with this command:
Next I added "therubyracer" to Gemfile (because less need it) and then installed the dependencies using "bundle install". So, when I try to generate the admin (padrino g admin), I've got this error:
So, what's going wrong?
similar issue here, with
It was working well previously, I'm not sure how I've broken it...
You need to use mongoid v "2.4.12" because the 3.x.x version has different connection method
gem 'mongoid', '2.4.12' gem 'bson_ext'
source :rubygems # Project requirements gem 'rake' gem 'sinatra-flash', :require => 'sinatra/flash' gem 'therubyracer' # Component requirements gem 'bcrypt-ruby', :require => "bcrypt" gem 'rack-less' gem 'less' gem 'slim' gem 'mongoid', "2.4.12" gem 'bson_ext' # Test requirements gem 'rr', :group => "test" gem 'riot', :group => "test" gem 'rack-test', :require => "rack/test", :group => "test" # Padrino Stable Gem gem 'padrino', '0.10.7'
To work with mongoid 3.x.x , in this moment, i'm use this hack (this is my first time to use mongoid :D:D:D) :
development: sessions: default: database: mongoid hosts: - localhost:27017
def self.authenticate(email, password) account = where(email: email).first if email.present? account && account.has_password?(password) ? account : nil end
and test it :D
This code is very ugly and too simple (the connection method is simple copy&past from mongiid document) but work :D
in this weekend i'm work to patch padrino to work with mongoid 3.x.x
sorry i'm missing this step :
Padrino.before_load do Mongoid.load!(File.join(Padrino.root,"config/database.yml")) end
added a commit
Jul 18, 2012
added a commit
Aug 7, 2012
after installing padrino and create a bare project:
Then I added mongo gem to Gemfiles and ran
=> Problem loading ./config/boot.rb
Is this related with this mongoid 2.x, 3.x problem?
thanks in advance