bst365体育投注网址大全

Questions tagged [ruby]

bst365体育投注网址大全 Ruby is a multi-platform open-source, dynamic object-oriented interpreted language, created by Yukihiro Matsumoto (Matz) in 1995. The [ruby] tag is for questions related to the Ruby language, including its syntax and its libraries. Ruby on Rails questions should be tagged with [ruby-on-rails].

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

What are these errors from a gem trying to tell me?

I am running a program from the 'coursegen' gem which I am writing and I'm getting these errors which I don't understand. Users/pitosalas/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/specification.rb:...
0
votes
0answers
10 views

Ruby on Rails Stop/Reset Running Cron

I have a website running on Ruby on Rails 5 and I have a cron setup to run. While testing the cron I ran rails cron. After I was done testing it, I stopped the cron by doing CTRL + C, however, when I ...
0
votes
0answers
16 views

How to find sub-directory exists in Linux machine using ruby

I have a directory in Linux machine have sub directory's. need to identify sub directory and also need to identify is that directory is a symlink. Below code not working for me File.directory?( "/...
0
votes
1answer
26 views

How to write Java String.format to ruby code?

How to write this code in ruby? I can't understand String.format("%04d", validateHash(hash) ? ((0xFC & hash[0]) << 5) | (hash[hash.length - 1] & 0x7F) : 0); private static ...
0
votes
2answers
13 views

How to implement marketplace: admin side show complete orders with list of purchased items: A challenge I cannot tackle

I'm currently stuck on a problem that I do not know how to tackle. I am currently working on a marketplace and a user can successfully, browse items, add items to cart and successfully purchase them ...
1
vote
2answers
21 views

How to order in descending order of two variables in rails?

I have written query like this @data = Data.where(value: params[:value]]).order(created_at: desc) data1 = Result.where(value: params[:value]]).order(created_at: desc) if data1?present @data <&...
0
votes
0answers
22 views

Ruby - convert bash-style file selector into a regex [duplicate]

Is there a pre-existing way, in Ruby, to convert a file selector into a Regexp? For example, on the bash shell I might do this: find ~/software | grep foo*.png In ruby, let's say that I already have ...
0
votes
1answer
13 views

Ajax response in erb from ruby method defined in controller

I have a ruby controller file with various methods defined, i want to get response of one of the method in erb i.e frontend using ajax call. I am a beginner in ruby, so doesn't have much experience of ...
0
votes
1answer
11 views

How to calculate a database field with using other fields?

I have this crypto-application that needs to calculate the current market value of inserted values. I have DB-Table called Crypto-Items. Each crypto-item has three fields "Crypto_Currency", &...
0
votes
0answers
5 views

How to test gRPC Ruby Client invoked in a rails application?

I have a running gRPC Server & I wrote a ruby client in my rails application to invoke request to the following. The client is working well, but I need to write spec for the client-service I have ...
0
votes
0answers
5 views

Ruby Open SSL RC4 No Salt Description

I'm trying to find below similar command in Ruby echo "encrypted"| openssl enc -d -base64 -rc4 -nosalt -pass pass:secretkey
0
votes
0answers
8 views

“gem install cocoapods” doesn't work (Windows 10)

Trying to install CocoaPods for a React Native project, but to no avail. It keeps throwing this error: https://gist.github.com/hiimjustin000/751d03ad245425c9b7348c5850bea95d. Any help would be ...
0
votes
2answers
15 views

How can I check if a model has papertrail?

lets say I have an active record model class "Post" that might or might not have paper_trail. How can I programatically find out if it is paper_trail enabled? I tried things like: Post....
0
votes
0answers
11 views

Undefined method `image' in Shrine

I try to add Shrine gem to an existing project that uses Paperclip. I added a Shrine image to a new model (just for a check). So I created model Country with this db table: create_table "...
0
votes
1answer
9 views

Rails - Minitest + Capybara + Selenium - Test destroy action

I am new to Minitest / Capybara / Selenium. But I want to test my destroy Controller action. I an trying the following and it is failing test "destroy" do companies_count = Company.count ...

15 30 50 per page
1
2 3 4 5
14285