我最近部署了我的 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
我需要做些什么才能使其正常工作吗?谢谢。