Tag: heroku devise

Rails + Devise + delayed_job?

我有一个使用Heroku上的Devise的Rails 3应用程序。 问题是我正在使用Sendgrid发送电子邮件,而且电子邮件递送速度很慢,这会让应用程序挂起。 所以我有兴趣使用delayed_job在后台排队电子邮件,因此我的应用程序响应用户。 Devise如何与delayed_job一起使用? 设置Devise以使用delayed_job的任何方法?

设计用户ID会在自动增量中跳过多个数字

我有一段代码,以编程方式创建一个新的设计用户: user = User.new user.username = params[:username] user.email = params[:email] user.password = params[:password] if user.save render :json => user else render :json => user.errors end 我最近注意到user id在我的记录中跳过了大约30个数字。 看着我的记录,我有: 知道什么可能导致增量的这个巨大差距? 用户无法删除其帐户。

rails,devise,heroku和多个dynos

我们有一个在Heroku上运行的应用程序,它有多个dynos。 假设该应用程序有2个dynos,当用户登录时,他将被第一个dyno服务。 如果由于某种原因,后续请求由第二个dyno提供,则他看起来没有登录。 修复此问题的唯一方法(从我们测试的内容)似乎是将会话存储设置为cookie存储。 有没有其他人遇到过这个问题?

Heroku 您提供了devise_for:users但您的应用程序中没有用户定义的模型

我有一个rails 3(3.0.9)应用程序在ruby 1.8.7上工作,我的计算机上的gem devise(1.4.2)工作得很好。 我试图在heroku上推送它,我在应用程序加载时收到以下错误消息: [WARNING] You provided devise_for :users but there is no model User defined in your application => Booting WEBrick => Rails 3.0.9 application starting in production on http://0.0.0.0:43292 => Call with -d to detach => Ctrl-C to shutdown server Exiting /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/inflector/methods.rb:124:in `block in constantize’: uninitialized constant User (NameError) from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/inflector/methods.rb:123:in `each’ […]

heroku rails app数据库迁移问题

我最近在我的rails应用程序中添加了设计确认模块。 我的应用程序在dev中运行良好。 但是,当我把它推到heroku时,它说“我们很抱歉,但出了点问题。” 以下是我的heroku日志 – Rendered devise/confirmations/new.html.erb within layouts/application (2.7ms) 2012-02-03T01:55:07+00:00 app[web.1]: Rendered devise/shared/_links.erb (0.5ms) 2012-02-03T01:55:07+00:00 app[web.1]: cache: [GET /users/confirmation/new] miss 2012-02-03T01:55:07+00:00 app[web.1]: Completed 200 OK in 19ms (Views: 16.9ms | ActiveRecord: 0.0ms) 2012-02-03T01:55:07+00:00 heroku[router]: GET personaldiary.herokuapp.com/users/confirmation/new dyno=web.1 queue=0 wait=0ms service=42ms status=200 bytes=1540 2012-02-03T01:55:11+00:00 app[web.1]: 2012-02-03T01:55:11+00:00 app[web.1]: 2012-02-03T01:55:11+00:00 app[web.1]: Started POST “/users/confirmation” for 50.131.164.83 at […]

注销在本地工作,但不在Heroku上工作

所以我正在使用设计登录/注销。 我注意到我的sign_out链接在本地运行得很好,但即使在我添加,提交和推送之后,它也无法在Heroku上运行。 这是我在Heroku日志中看到的内容 2014-04-23T22:16:09.987029+00:00 heroku[router]: at=info method=GET path=/users/sign_out host=peaceful-atoll-4795.herokuapp.com request_id=16559a9f-0cff-4179-8aeb-d393ae44de38 fwd=”108.233.86.201″ dyno=web.1 connect=60ms service=34ms status=404 bytes=1616 请注意,它尝试使用GET方法注销何时应该是DELETE。 当我的路线正确时,为什么使用GET方法? 耙路线: Prefix Verb URI Pattern Controller#Action new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_password POST /users/password(.:format) devise/passwords#create new_user_password GET /users/password/new(.:format) devise/passwords#new edit_user_password GET /users/password/edit(.:format) devise/passwords#edit PATCH /users/password(.:format) devise/passwords#update PUT /users/password(.:format) devise/passwords#update devise.rb设置如此…… […]

未能在heroku的设计设置中找到ENV

这个没有版本控制你的密钥的要点很棒,而且我现在已经使用了几次不再版本化我的rails secret-key-base。 我尝试将它用于heroku上的devise secret_key,我的尝试失败了。 它在dev中工作正常,但拒绝让我推送到heroku – 说我创建的设计密钥(与上面的要点相同)没有设置。 我使用硬编码的密钥(检入git),但不是在我使用以下内容时: Devise.setup do |config| config.secret_key = ENV[‘DEVISE_SECRET_KEY’] … (与相关的环境变量三重检查,它在那里) 在推送到heroku期间,似乎在预编译资产时失败了 $ git push heroku master … (bundle stuff here) Running: rake assets:precompile rake aborted! Devise.secret_key was not set. Please add the following to your Devise initializer: config.secret_key = ‘0cfa796871e0… /tmp/build_…/vendor/bundle/ruby/1.9.1/gems/devise-3.1.1/lib/devise/rails/routes.rb:446:in `raise_no_secret_key’ /tmp/build_…/vendor/bundle/ruby/1.9.1/gems/devise-3.1.1/lib/devise/rails/routes.rb:195:in `devise_for’ /tmp/build_…/config/routes.rb:2:in `block in ‘ …( […]

Rails 4.1将秘密推向heroku

Rails 4.1.0.beta1和Devise。 我正在尝试从版本控制中删除所有密钥,并且我已升级到Rails 4.1以给这个新的秘密。一个镜头 试图将Devise的config.secret_key推送到heroku但它在资产之后失败:预编译 Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! Devise.secret_key was not set. Please add the following to your Devise initializer: config.secret_key = ‘EXAMPLE_KEY_HERE’ Please ensure you restarted your application after installing Devise or setting the key. 以下是我的更改,我将在评论中留下的旧代码。 (有用) devise.rb # config.secret_key = ‘THIS_IS_A_FAKE_KEY’ #<—this_is_commented_out config.secret_key = Rails.application.secrets.devise_secret_key […]

如何重置所有设计会话,以便每个用户都必须重新登录?

在heroku上托管此rails应用程序的某个神秘点X,登录用户将突然以另一个用户身份登录。 我正在使用devise gem进行身份validation。 这已经发生在我们所知道的2个用户身上。 我目前正在追查这个问题的根本原因。 我现在需要做的是使所有设计会话无效,以强制用户再次登录。 用户登录后,问题似乎消失了。 我尝试重置我的secret_token,但我没有被迫再次登录。 然后,我将我的网络dynos缩小,然后备份。 我也重新启动了应用程序。 所有尝试获取secret_token更改以重置会话。 还有其他想法吗?

应用程序使用Devise gem在Heroku上给出应用程序错误

我正在使用设计gem,我在让我的应用程序在heroku上工作时遇到了问题。 我不确定这是数据库的问题还是设计自己。 在安装设备之前它工作正常。 我在下面放了一个heroku日志。 2014-03-03T05:01:41.875781+00:00 app[web.1]: => Ctrl-C to shutdown server 2014-03-03T05:01:41.859124+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app’ 2014-03-03T05:01:41.875781+00:00 app[web.1]: => Booting WEBrick 2014-03-03T05:01:41.875781+00:00 app[web.1]: => Rails 4.0.2 application starting in production on http://0.0.0.0:24518 2014-03-03T05:01:41.859124+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval’ 2014-03-03T05:01:41.875781+00:00 app[web.1]: => Run `rails server -h` for more startup options 2014-03-03T05:01:41.875781+00:00 app[web.1]: Exiting 2014-03-03T05:01:41.859124+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in […]