0

我最近部署了我的 Ruby on Rails 应用程序,从在我的机器上本地运行它到 VPS 服务器。使用用户名和密码,管理部分不起作用。它在本地工作,但在网上,我无法管理我的用户详细信息。该应用程序的其余部分似乎工作正常,只是不是管理员。

在我的 db/seeds.rb 我有:

Admin.create(:email => "admin@admin.com", :password => "admin_password")

#unless Rails.env.production?
#  1000.times do
#    Factory.create(:user)
#  end
#end

categories_file = File.join(Rails.root, 'config', 'categories.txt')
if File.exists?(categories_file)
  File.open(categories_file, 'r') do |f|
    while category = f.gets
      Category.create(:name => category)
    end
  end
end

我需要做些什么才能使其正常工作吗?谢谢。

4

1 回答 1

0

有人跑了:

RAILS_ENV=production bundle exec rake db:seed

从服务器上的生产实例(无论是什么),现在它正在工作。

于 2013-06-04T09:31:03.577 回答