Questions tagged [ruby-2.5]

For issues relating to development in Ruby, version 2.5. If your question applies to Ruby in general, use the tag [ruby].

47 questions
1
vote
1 answer

Passenger with Rails Action cable

I tried to deploy on production server Rails with actioncable (5.1.5) according to this tutorial https://www.phusionpassenger.com/library/config/nginx/action_cable_integration , on the same host and port, under a sub-URI But i've got 404 on my…
0
votes
1 answer

When i try to start the rails server i get an error of bug segmantation fault in mysql

-- Control frame information ----------------------------------------------- c:0103 p:---- s:0557 e:000556 CFUNC :connect c:0102 p:0612 s:0545 e:000544 METHOD /usr/share/rvm/gems/ruby-2.5.1/gems/mysql2-0.5.3/lib/mysql2/client.rb:90 [FINISH] c:0101…
0
votes
0 answers

ruby gsub cannot replace more than 1 character if file is iso8859-1

I just noticed very strange behavior of gsub method and maybe somebody can explain this to me. I have file which I open with standard f=File.read(filename) puts f.gsub('xxxxx','a') this works fine and all xxxxx strings are replaced with a if I open…
Mi Ro
  • 740
  • 1
  • 6
  • 31
0
votes
0 answers

Ruby on Rails Controller Update Method Issue

I enter a number with a decimal to this update, yet it comes out as a .floor'd Integer no matter what I try. I've tried 161.55.to_f and a few other fixes but nothing is working. class UsersController < ApplicationController def update …
atack
  • 55
  • 8
0
votes
1 answer

Thread.critical not working in ruby 2.5.0

I'm using ruby2.5.0 and I have the below function as part of my script. When I run it I get the below error: ensure in get_database_connection': undefined methodcritical=' for Thread:Class (NoMethodError) I understand the for ruby1.9.0 and…
0
votes
2 answers

proper Ruby version for Google App Engine Ruby Standard Environment w/Rails

Using the default app.yaml configuration provided by Google for Google App Engine Ruby 2.5 standard environment, I cannot deploy successfully when using Rails. If I use Ruby 2.5.5 locally, and in my .ruby-version and Gemfile, the deploy fails…
0
votes
2 answers

Ruby key getting replaced, instead of a new key created

ruby 2.5 I have the following code: test = {'primer' => 'grey'} layers = ["tan","burgundy"] fillers = ["blue","yellow"] layers.each do |l| fillers.each do |f| test[l] = {} if !test.respond_to?(l) test[l][f] = {} if…
EastsideDev
  • 6,257
  • 9
  • 59
  • 116
0
votes
1 answer

Invalid Byte Sequence in UTF-8 from Excel file

(Ruby 2.5) I have a method that reads and parses a csv file that's being uploaded via Alchemy CMS def process_csv(csv_file, current_user_id, original_filename) lock_importer errors = [] index = 0 …
Doolan
  • 1,293
  • 1
  • 13
  • 28
0
votes
1 answer

ruby 2.5: set timeout on tcp socket's read

Ruby 2.5's doc says that for: myTCPServer = Socket.tcp(host, port, nil, nil, :connect_timeout=60), the only option it accepts is :connect_timeout. (Ruby 2.0's doc may have a copy-paste error, claiming that :timeout is another option, but not saying…
Camille Goudeseune
  • 2,934
  • 2
  • 35
  • 56
0
votes
1 answer

How to fix "uninitialized constant Gem::GEM_PRELUDE_SUCKAGE" in RubyGems tasks

My RubyGems isn't working, throwing an error which goes as follows, triggering (nearly) on any Gem task: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:1081:in `': uninitialized constant…
0
votes
0 answers

Why a value which was not nill, after a line becomes nil?

I transformed a Rails API application to a normal Rails application, without problem. Then it started giving me some problem, before with the same code it was working perfectly. I have a Telegram bot and Telegram sends the POST request to my Rails…
Ferdi2005
  • 61
  • 2
  • 8
0
votes
1 answer

Issue connecting to S3 from AWS Lambda(Ruby2.5)

I am trying to connect to AWS S3 bucket from AWS lambda. I am using aws-sdk-s3 gem. My code working fine on local machine. I was able to upload files to S3. But the same code giving timeout on lambda. def client Aws::S3::Client.new({ region:…
0
votes
2 answers

Can't test if directory already exists from within Fastlane with Ruby

I can’t test whether a directory exists from within a Fastlane action nor lane. None of the following work for save_path = "./dir_name" nor save_path = "dir_name" in the current directory (from which fastlane is being…
Wanda B.
  • 161
  • 2
  • 11
0
votes
2 answers

ruby 2.5 on ubuntu:latest error assets:precompile

I support Rails 4.2.5 application on Ruby 2.5. Packages and rails are ok, but when I run rake assets:precompile I have error. eric>' /var/lib/gems/2.5.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2…
Ivan Ivanov
  • 193
  • 3
  • 12
0
votes
3 answers

Ruby reverse.each_with_index and delete_at causing problems in latest Ruby/Rails

So, I'm well aware of the perils of removing items in an iteration block (this is looping in reverse), and I know Matz mentioned something about mutations in iterations causing stability problems, but I can't seem to figure this one out. This…
user58446
  • 269
  • 1
  • 3
  • 17