I'm having trouble installing older version of ruby on my machine (osx mountain lion). I was wondering if anybody has ideas on how to resolve this compile issue:
$ rvm install 1.8.7
Warning! Requested ruby installation which requires another ruby…
I've inherited a pretty old Rails app (running v2.3.18 on Ruby Enterprise 1.8.7) and I'm trying to get it up and running locally.
After installing the gems and performing migrations I'm trying to startup the server with rails server as I'm used to,…
@time = Time.now
if @time.zone == "IST"
@time = Time.now.utc
end
i tried the above code, and it works for me. but how to change the time according to the country when the application is opened in some other country.
i.e.,
If the application…
I have a hashes of JSON generated by php application , which i want to read in my rails controller.
Is there any way can i convert this json in hashes again , so that i can able to read it.
json_from_php = "{'coms':[{'com':{'title':'kk…
Can any one suggest me any gem or a way to solve the special characters issue occurring in ruby 1.8.7 and rails 3.2.13.
I want to replace the special characters instead of removing.
I have tired using iconv gem. It works for some special characters…
Ruby 1.8.7-p375 on OS X Sierra. I'm having a problem with a library that talks to a fedex rates SOAP service seg faulting.
~/.rbenv/versions/1.8.7-p375/lib/ruby/gems/1.8/gems/httpclient-2.7.2/lib/httpclient/ssl_socket.rb:46: [BUG] Segmentation…
I am trying to install particular version of libxml2.
I used brew search libxml2 but it seems there is only one result is available.
Brew is installing libxml2-2.9.4 but need libxml2-2.9.0 version so i tried to install by source and followed the…
i used iconv to replace the character:
<%= Iconv.iconv("ascii//translit", "utf-8", "ENDÜœSTRIYEL").to_s %>
it displays,
END?oeSTRIYEL
whereas in irb it shows like this:
irb(main):006:0> Iconv.iconv('ascii//translit', 'utf-8',…
I just want to read a csv file and discard the header row.
When I do csv = CSV.read('file_name.csv','r') I get
.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/csv.rb:98:in `read': can't
convert String into Integer (TypeError)
When I do
csv =…
I have the following code:
team_articles = user.npt_teams.to_a.inject({}) {|arts,team|
arts.merge({ team.name =>
NptArticle.join(:npt_authors).join(:users).join(:npt_teams).where(:npt_teams__id => team.id).to_a.uniq})
}
It causes my…
I have the following query written in SQL:
Select *
From npt_articles
Inner Join npt_authors
Inner Join users
Inner Join npt_teams
Where npt_teams.id In (1)
and the following sql generated by the sequel gem:
SELECT *
FROM …
ok, so lets get the basics out of the way.
I'm running ruby 1.8.7, I'm using the sequel gem version '2.6.0'.
I have a table called Users and a table called Teams
Right now a user can have one team and as such it's relation is:
belongs_to…
I have a file called Output.json:
[
{
"name": "krishna",
"service": "postman",
"host": "xxxxxx",
"doing": [],
"pool": "xxxxxx",
"roleType": "yyyyy",
"simple": true
}
]
And this is my Test.rb file:
require…
I am using fastercsv gem for csv export with utf-8 encoding.
When ever i export any arabic content in my csv using utf-8 , when i try to open in windows it comes out as some strange characters. where as in ubuntu it comes fine.
I am working with…
In my Rails Application i am having a module called appointments. I want to alerts those appointment events for each and every user via Google Calendar. So I want to Store/Sync Events in Google Calendar in Ruby Application. I want to allow to store…