Questions tagged [ruby-1.9.3]
For issues relating to developing in Ruby, version 1.9.3. If your question applies to Ruby in general, use the tag [tag:ruby].
497
questions
0
votes
0answers
5 views
Rack::OAuth2::Client::Error in rails 3 app after authenticating user
In my rails project, I am using the oauth2 gem for authentication. In the configuration, I have configured authentication, token, and user info URL correctly. When the user is login and redirected ...
0
votes
0answers
81 views
Openssl and zlib isses on Mac Big Sur install 1.9.3
OS : MacOS Big Sur
rvm : rvm 1.29.10-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
HomeBrew :
Homebrew 2.7.0
Homebrew/homebrew-core (git revision 75b005; last commit ...
0
votes
0answers
43 views
failed rspec when upgrade ruby version from 1.9.3 to 2.0.0
I'm upgrading ruby version from 1.9.3 to 2.0.0, however, when version ruby 2.0.0, it's failed as below:
undefined method `ancestors' for #<Delayed::Backend::ActiveRecord::Job:...
8
votes
1answer
324 views
Why does ruby create 3 objects after a class is created?
I was studying about Ruby's metaclass. I read this answer where it is nicely described what metaclass is. It's showed there when a class is created it will create two objects. Which is understandable. ...
0
votes
1answer
26 views
ruby not working in all directories windows 10
Here is my scenario:
I have a directory I want to run rake commands.
I install ruby 1.9.3.
I open a new command window in the default location of C:/Users/Administrator
I run ruby -v and get the ...
8
votes
5answers
9k views
How to set SameSite attribute to 'None; Secure' in Rails3.1.12 and Ruby1.9.3
A cookie associated with a cross-site resource at https://example.com/ was set without the SameSite attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they ...
1
vote
1answer
536 views
How to use mysql2 0.3.16 with Ruby 1.9.3? (uninitialized constant Mysql2::Client::SECURE_CONNECTION)
I'm trying to set up my local dev environment to match my team's. I can't upgrade Ruby/Rails/mysql2 (for the time being).
I know my local MySQL config is good (enough?) because I can create a new ...
2
votes
1answer
681 views
Where are the official Ruby 1.9 Docker Images?
I ran the following Docker command from a Git Bash shell on Windows 10:
docker pull ruby:1.9.3
to get the following output (I removed a couple lines for clarity):
1.9.3: Pulling from library/ruby
.....
5
votes
1answer
598 views
What happen if i use ruby version 2.5.1 with rails version 2.3.18?
What happen if i use ruby version 2.5.1 with rails version 2.3.18 ?
I had rails application built on rails 2.3.18 and ruby 1.9.2p320,
I want to upgrade version of ruby only not the rails is it ...
1
vote
1answer
70 views
Sphinx Issue with Ruby 1.9.3?
I have recently moved a web app from ruby 1.8.7 to 1.9.3 and everything is going great, except for searching. Everything was working fine before bumping ruby. Here's my controller code:
ids = ...
1
vote
1answer
25 views
template.path_without_format_and_extension Not working in rails 3.0.3. Getting undefined method template
I am using i18n in rails 3.0.3 and user have functionality to edit text. If user save text then it comes from database instead of en.yml file. I have override t helper like below:
def c_t(key, ...
0
votes
1answer
16 views
Spec for changed local.yml
I have a method that changes some local.yml variables. To test that method I had to stub those variables, but I also want to test if the local.yml was changed and what was written on it. Is it ...
0
votes
1answer
15 views
How to create a Rails project along with its database in Rails2?
I have the project built using
Rails 2.3.18
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
How to create the new project along with its Database.
Like in rails 4 & 5 we do
rails new ...
0
votes
1answer
15 views
How to include gems in the project using Rails 2 and Ruby 1.9.3?
I have the project built using
Rails 2.3.18
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
I do not have any Gemfile my project so how include gems in it.
2
votes
0answers
149 views
Tagged logging in Rails 3.1.12
I would like to know how the tagged logging can be implemented in Rails versions below 3.2. I have tried to override the logger.rb using a custom logger.
lib/custom_logger.rb
class CustomLogger < ...
0
votes
1answer
70 views
compile ruby 1.9.3 along with required gems to make it as like package bundle
We don't have ruby 1.9.3 rpm for CentOS 5.x and am looking to compile this ruby version from source. Am able to compile it using below steps,
cd /usr/src wget http://ftp.ruby-lang.org/pub/ruby/1.9/...
3
votes
2answers
136 views
Get local variables of previous scope
I am making a Ruby REPL to be used inside an application. I made code:
a = 1
b = 2
currentScope = []
Kernel.local_variables.each do |var|
currentScope << [var,Kernel.eval(var.to_s)]
end
...
0
votes
0answers
22 views
parse json data consists of null values
Trying data['external_address_package'] getting error like :
**syntax error, unexpected ':', expecting '}'
{"data":{"external_address_package":{"...**
{"data":{"external_address_package":{"...
0
votes
2answers
896 views
“invalid multibyte char” error when using greek characters in Rails enum
This:
enum UnitOfMeasure: [ :g, :mg, :µg]
gives:
Syntax Error: invalid multibyte char (US-ASCII)
I hope I won't be forced to add a table just for this.
8
votes
2answers
365 views
Why does Dir.glob(“*.txt”).sort also need .each?
Dir.glob("*.txt") {|f| p f} prints filenames.
Dir.glob("*.txt").sort {|f| p f} fails with an ArgumentError.
Dir.glob("*.txt").sort.each {|f| p f} prints filenames in alphabetical ...
1
vote
1answer
114 views
Can I use latest Capistrano which requires ruby >2, to deploy Rails application that requires ruby 1.9.3?
I want to automate a legacy application deployment with Capistrano, but the application requires ruby 1.9.3, and Capistrano, as of this writing, requires at least ruby 2. Would it still be possible to ...
0
votes
2answers
494 views
Print hash in ruby with indentation for each line
I am trying to print a hash of strings and integers in ruby in the following format:
x = {"abc" => 12,"abcdef" => 44, "sryyy" => 5}
puts x
the output should look like:
abc 12
abcdef ...
0
votes
1answer
1k views
ruby array of json object access a value
I have an array of json object called line:
[{"label":"Name","value":"Bob","identifier":"field2","type":"oneLineText","page":1,"page_name":"Step 1","width":"100%"},{"label":"Email","value":"bob@...
0
votes
0answers
1k views
OpenSSL::SSL::SSLError hostname does not match the server certificate
I'm trying to make an API call to SmartDebit a 3rd party direct debit processing website from my Ruby 1.9.3, Rails 2 app.
I'm getting this error:
OpenSSL::SSL::SSLError·hostname does not match the ...
2
votes
0answers
78 views
undefined method translate during Rails 2.3 -> 3.2 upgrade
Working on upgrading a Rails 2.3.17 app to Rails 3.2.22.2 (running ruby 1.9.3-p551). Was able to get through the painful portion of ugprading all the gems / updating the directory structure / adding ...
0
votes
1answer
27 views
mysql not connecting to environment after ruby-2.2.2 upgade
I have just upgrade our legacy ruby app from ruby-1.9.3 to ruby-2.2.2. The app runs fine locally, I have successfully deployed it to our staging environment but for some reason it is now having issues ...
1
vote
1answer
21 views
Syck.dump empty hash throws IO exception
I am busy writing a data migration which is going to allow us to change yamlers from Syck, to Psych. For this I need to migrate some columns in our data base. I have hit the following weird edge case
...
1
vote
1answer
170 views
How can I monkey-patch a class inside a module?
I'm using the Xeroizer gem and want to monkey patch one of the pull requests which adds functionality I need.
There are four commits on that request, and for some of them it involves patching a class ...
1
vote
2answers
271 views
How to print keys and values from a text file
I have a file called "output.txt":
"name": "abc",
"age": 28,
"name": "xxx",
"age": 11,
"name": "yyyb",
"age": 15,
I want to read the file and print the name and age values on ...
0
votes
1answer
363 views
Install ruby-oci8 using ruby 1.9.3-p551 in OS X El capitan 10.11.3
I am trying to Install ruby-oci8 using ruby 1.9.3-p551 in OS X El Capitan 10.11.3, But I am getting this error.
Installing ruby-oci8 2.2.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed ...
0
votes
1answer
285 views
bundle install error with conftest.c
Currently failing to bundle and I can't quite pinpoint how to solve the issue.
╰─ rvm list
rvm rubies
=> ruby-1.9.3-p545 [ x86_64 ]
ruby-2.0.0-p451 [ x86_64 ]
ruby-2.0.0-p598 [ x86_64 ]
* ...
0
votes
1answer
270 views
DEPRECATION `RSolr.escape` is deprecated (and incorrect). Use `Rsolr.solr_escape` instead
Project environment
Ruby 1.9.3p392
Rails 3.1.12
gem 'sunspot_rails' , '2.0.0'
gem 'sunspot_solr' , '2.0.0'
[DEPRECATION] RSolr.escape is deprecated (and incorrect). Use Rsolr.solr_escape instead.
...
1
vote
0answers
178 views
How To Write Rspec for Class methods in rails?
In my Rails application, I have a Model named CrTransaction. It contains the below class method,
def self.set_exclusion_attributes(ach_payment_id)
CrTransaction.where(:id => ach_payment_id)....
-1
votes
1answer
143 views
How can connect routes in rails 3 using folders?
I'm getting an error No route matches [GET] because trying to create folders per certain controllers
Here the app structure:
|controller,helper,view|
|user_management| ------> FOLDER
|user| ...
6
votes
1answer
2k views
Error while installing ruby ruby-1.9.3-p551
While installing ruby version 1.9.3-p551 i get the following error.
ruby-1.9.3-p551 - #removing src/ruby-1.9.3-p551 - please wait
Searching for binary rubies, this might take some time.
No binary ...
1
vote
1answer
106 views
upgrading ruby 1.8.7 to 1.9.3 load error
I'm getting a load error when trying to upgrade to ruby 1.9.3 "small steps". There is a load error, but I am autoloading the lib directory. Does anyone know why this is happening?
application.rb:
...
0
votes
0answers
169 views
Error in installing ruby-1.9.3-p551 on OSX 10.10.5
I have a new OS 10.10.5 installed on my Mac which has a default ruby-2.0.0p481. However, I need ruby-1.9.3-p551 for specific reasons of our system. When I am trying to install ruby-1.9.3-p551 using ...
0
votes
1answer
116 views
String array to sentence ruby 1.9.3
I have tried to convert it to the array and then try to use join(',') but this is not converting in a sentence can any buddy help on it.
convert this string
"[\"one\", \"two\", \"three\"]"
to ...
3
votes
0answers
772 views
Support for TLS_1.1 in ruby 1.9.3
One of client has notified that they would be upgrading their SSL version to TLS1.1 and would be cease the support of TLS1.0
Reading these, I came to know that OpenSSL handle the protocol negotiation ...
1
vote
1answer
311 views
Installed Ruby 2.0.0, but an error tells me I have 1.9.3 installed
I just cloned my Rails app onto my new computer. Ruby 2.0.0 seemed to install with no issue, but when I run sudo bundle install inside my app, I get an error telling me I have Ruby 1.9.3 installed:
$ ...
2
votes
3answers
1k views
Executing a Ruby method inside a Net::SSH session
Ruby 1.9.3, net-ssh 2.9.2
I am working on a project, in which I need to diff the same directory (and its subdirectories) on two different servers (local and remote). From there, I need to copy the ...
1
vote
1answer
61 views
IO read not reading entire file
I have a very large text file, 958 MBAnd I have created the following script
f = IO.read ("Playback.xml").encode ("utf-8", replace: nil)
separate_files_array = f.scan /strong text<Bla>.*...
8
votes
1answer
2k views
Rails Logfiles “not opened for writing”
I am in a process of migrating my application from ruby 1.8.7 to 1.9.3 (and later upgrading Rails). However I geht some problems with logging in 1.9.3.
By using the following code in environment.rb ...
0
votes
1answer
89 views
RoR Agile Web Dev 4 CSS not loading
I am new to RoR and I am following the Agile Web Development with Rails 4 book and I am to the point where we add CSS styling to the store front page (page 135 "8.1 Iteration C1: Creating the Catalog ...
0
votes
1answer
37 views
Call method to generate arguments in ruby works in 1.8.7 but not 1.9.3
This is something that I had working in ruby 1.8.7, but no longer works in 1.9.3, and I am not sure what changes make this fail.
Previously, I had something like this
myFunction(submitArgs())
where ...
1
vote
0answers
112 views
How do I use String.include? with forward slashes?
I'm using a rake task in Rails to look for strings to see if they have a now-decommissioned CDN in them:
if project.featured_thumbnail_url.include? "//cdn42.cloud.pizza"
...
end
This doesn't seem ...
0
votes
1answer
277 views
Stub AWS services to return an object value in Cucumber/Capybara
In the Rails app I am building, we are using the results of AWS (DynamoDB) calls made by the controller to populate the view, as part of our replacing "standard" Rails SQL storage with DynamoDB ...
0
votes
1answer
397 views
How do I upgrade a rails 4.1 app from ruby 1.9.3 to ruby 2.1.5 without using rvm
I'm told to update my rails project from ruby version 1.9.3 to 2.1.5 but I don't know how
I updated my gem file to reflect 2.1.5, and then tried bundle install again, it seemed to work mostly...
...
0
votes
1answer
124 views
Using unsupported ruby binary interpreters with Rails LTS
I've done a little bit of reading and I can't seem to find a good answer to this question. I wanted to know if somebody could comment if there are any known dangers to using Rails LTS (https://...
0
votes
1answer
112 views
Why there is discrepanceis in number of instance methods?
While going through the ruby monk I have seen the count of Float instance methods as 201 but when I tried in my irb it is showing just 114. It will be really helpful if someone make me understand why ...