狂欢创建管理员帐户ubuntu

时间:2013-05-24 20:41:51

标签: ubuntu admin spree

我一直在寻找几天,但我没有想出解决方案。我是ruby的新手,但我想通过使用狂欢来开发自己的在线商店。

我使用:rails:Rails 3.2.13 ruby:ruby-1.9.3-p429 RUBYGEMS版本:1.8.24

我的Gemfile如下:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

group :development do
  gem 'sqlite3'
  gem 'pry-rails'
end

group :production do
  gem 'thin'
  gem 'pg'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

group :development, :test do
  gem 'rspec-rails', '~> 2.0'
  gem 'shoulda'
end


gem 'spree'
gem 'spree_auth_devise', :github => "spree/spree_auth_devise"
gem 'spree_core', :github => "spree/spree", :branch => "master"
gem 'spree_frontend', :github => "spree/spree", :branch => "master"
gem 'spree_backend', :github => "spree/spree", :branch => "master"
gem 'spree_api', :github => "spree/spree", :branch => "master"
gem 'pry'

gem 'jquery-rails'


# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

我使用以下命令:

捆绑安装 rails g spree:安装 rails s

通过这样做,我有狂欢默认存储与登录菜单...但我无法登录..我永远不会创建一个用户...我通过执行rake spree_auth:admin看到了:创建 在rails g spree之后:安装......它应该创建一个管理员用户......但不知道......有什么帮助吗?

2 个答案:

答案 0 :(得分:3)

从终端创建Spree管理员帐户:

rake spree_auth:admin:create

想要为生产模式创建管理员用户:

RAILS_ENV=production rake spree_auth:admin:create

如果您想使用默认管理员帐户(spree@example.com,spree @ 123),请继续按 ENTER ,这将为您创建默认的狂欢管理员帐户!

答案 1 :(得分:0)

如果您运行此命令,系统将提示您输入管理员用户的电子邮件地址和密码。

rake db:seed