module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user def connect #puts params[:auth_token] self.current_user = find_verified_user logger.add_tags 'ActionCable', current_user.name end end end I don't use web as end point for action cable, so I want to use auth_token for authentication. By default action cable use session user id for authentication. Ho
I'm trying to run sidekiq worker with Rails. When I try to docker-compose up worker I get the following error: worker_1 | Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED) worker_1 | /home/app/Nyvur/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/client.rb:332:in `rescue in establish_connection' worker_1 | /home/app/Nyvur/vendor/bundle/ruby/2.2.0/gems/redis-3.2.2/lib/redis/clie
A gem native extension might link to a separate library that needs to be pre-installed, and RMagick is an example of that. However, the term really just means "includes some code that needs to be compiled for your machine". The code is compiled and linked so that the resulting executable file can be required by Ruby on the machine. The usual reasons for writing a Ruby C or C++ extension are: Speed
I am very afraid of making some modifications on the server. Because the server is working fine with the current settings. I will to explain: The server is an Amazon EC2 instance. In this instance I have: ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] rails -v: Rails 4.2.3 nginx -v: nginx/1.8.0 passenger -v: Phusion Passenger version 5.0.10 I have 1 Load Balancer, which has a li
When I type cap production deploy I get Capfile locked at 3.1.0, but 3.2.0 is loaded When I uninstall capistrano 3.2.0 I get Could not find capistrano-3.2.0 in any of the sources Run `bundle install` to install missing gems. Me gemfile has gem 'capistrano', '~> 3.1' gem 'capistrano-rails', '~> 1.1' And Capfile require 'capistrano/setup' require 'capistrano/deploy' require 'capistrano/bundler' requ
I am using Nokogiri to scrape web pages. Few urls need to be guessed and returns 404 not found error when they don't exist. Is there a way to capture this exception? http://yoursite/page/38475 #=> page number 38475 doesn't exist I tried the following which didn't work. url = "http://yoursite/page/38475" doc = Nokogiri::HTML(open(url)) do begin rescue Exception => e puts "Try again later" end end
The return value of the block becomes its content. Only the last line is being returned. You must concatenate the two strings together with + to produce a single return value: link_to("#", class: "add_fields btn btn-success") do name + content_tag(:i, "", class: "icon-plus icon-white") end You'll need to use html_safe to prevent the content of your tag from automatically being HTML encoded: link_t
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く