2

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

我使用: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:create after rails 看到了g spree:安装...它应该创建一个管理员用户...但不知道...有什么帮助吗?

4

2 回答 2

4

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

rake spree_auth:admin:create

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

RAILS_ENV=production rake spree_auth:admin:create

如果您想使用默认管理员帐户(spree@example.com,spree@123),那么只需按住ENTER 键,这将为您创建默认的 spree 管理员帐户!

于 2014-04-02T12:16:46.477 回答
0

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

rake db:seed
于 2014-01-30T21:44:29.457 回答