Displaying 20 results from an estimated 5000 matches similar to: "Converting time retrieved from MySQL"
2005 Mar 18
4
NoMemoryError on "gem install rails"
Greetings all--
Humble newbie requesting help here. I''ve just installed Ruby 1.8.2, Rake
0.4.15, and RubyGems 0.8.8. When I try to get Rails into place via "gem
install rails," I get the error below. What have I done wrong? Can anybody
throw me a rope?
Attempting local installation of ''rails''
Local gem file not found: rails*.gem
Attempting remote
2005 Mar 08
3
is there any rails hosting out there?
anyone?
-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| When you do something, you should burn yourself completely, like a good
| bonfire, leaving no trace of yourself. --Shunryu Suzuki
===============================================================================
2005 Mar 09
6
auto increment id
looking at the unit tests of activerecord leads me to think the db is
completely responsible for auto-incrementing the id field and rails does no
magic here. can someone confirm that this is a true statement?
that being the case - what is the preferred way to write database agnostic sql
for one''s schema since each of the dbs has slightly different syntax for this
functionality... does
2005 Mar 09
4
max requests for fcgi interface
I think my rails app has a slow memory leak that degrades performance
over the course of several days. I''d like to get to the bottom of it
but in the meantime I''d prefer to just bandage it and force the fcgi
library to start a new instance of my app every so often. Is there a
clean way to do this? Calling break in the each_cgi loop causes an
error. Sending SIGUSR1, which
2006 Jul 14
1
Converting Date string to Time Object
Hi,
I have MySQL model with created_on specified as :date. This means that the
day the record was created on is stored in the database as a string like
"2006-04-28". I want to be able output a something like "5 days ago". From
looking in the API I''ve found "strftime" and "*distance_of_time_in_words*".
Distance_of_time_in_words only accepts Time
2005 Mar 03
12
bug in postgresql ''now'' time handling??
line 212 of postgresql_adapter.rb is
return Time.now.to_s if value =~ /^\(''now''::text\)::(date|timestamp)/
i don''t think this will work. in postgresql the field ''now'' is pinned to the
SAME TIME for the duration of a transaction. eg. if you do
begin transaction;
insert into t values(42, ''now'');
# sleep one minute
2005 Mar 09
10
mysql vs postgres
I''ve used mysql for quite some time now. Other than crashing when the
partition gets full, I''ve had no problems with it.
But I''ve heard great things about postgres and have seen some people
say it''s much superior to mysql.
So, with a Rails application, is there any reason why I would want to
learn/use another DB besides mysql? Any pragmatic benefits?
2006 Jan 22
8
Date Calculation
I am trying to calculate the number of days between 2 dates using
Time.now - object.date where object.date is a date pulled from a
database. I want to display the age of the entry in the database in
days. I keep getting an error about not being able to convert a date
into a float. What am I doing wrong. If I use object.date -
object.date it seems to work but the answer is useless (0). I
2005 Mar 10
7
Forking FCGI dispatcher
I hacked a forking FCGI dispatcher for Rails. I have no idea if this is
the correct way to do it, but it seems to work fine. It improves memory
usage a bit; after it is started the processes share almost 10 MB (of 12
MB total), but unfortunately it drops to 2 MB after a few requests.
=====================================
#!/usr/local/bin/ruby
require File.dirname(__FILE__) +
2006 Apr 02
2
Problem with RSS feed from Rails Recipes
I''m trying to add an RSS feed to my app, and am going through the
Rails Recipes chapter on doing so. I get the following error when I
request the feed:
undefined method `gmtime'' for #<DateTime: 1963061961/800,0,2299161>
...
7: xml.pubDate CGI.rfc1123_date(@posts.first.created_on)
Any idea what''s up?
Pat
2006 Jun 13
2
four days on rails - nil object when you didnt expect it
Hi all,
Im trying to get my head around rails and to help along Im working
through "four days on rails" as this seems to give a good real world
example with multiple tables and relationships (the main thing I cant
work out!)
Ive got stuck. Some help would be really good here.
The controller has this code:
def list
@category_pages, @categories = paginate(:category, :per_page =>
2008 Jun 08
20
how to parse a "dd/mm/yyyy" formatted date string???
Hi,
I''m stuck. How do you parse a "dd/mm/yyyy" formatted date string???
I get a date format error.
Thanks in advance
Greg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2006 Jan 16
8
[newbie] This Month / Next Month / The One After That
What I want to do is simple.
I''d like code that prints out the name of this month (January) the next
month (February) and the one after that (March)
I''ve been able to print this month:
<% t = Time.now %>
<%= t.strftime(" This Month is: %B") %>
But I can''t figure out how to get the next months to print out!
--
Posted via
2006 Apr 20
5
Noobie problems with helper
I have the following helper method in application_helper.rb:
def format_date(date)
day = to_s(date.day)
month = to_s(date.month)
time = to_s(date.time)
date = day + "/" + month + " - " + time
return date
end
I am trying to call this method in a view like this:
<%= format_date(bounty.created_on) %>
create_on is a timestamp in mysql. I am
2006 Apr 04
11
Date/Time format and syntax
Hi,
Just wondering how I get both the current date and time to display here
(so far I can only get the date OR the time):
@tblregisteredphone.txtregisterdatetime = Date.today
Also, how can I change the format of the date and time from:
Tue Apr 04 00:00:00 GMT Daylight Time 2006
to
2006-04-04 12:04:00
??
I''m sure it''s very simple, I just don''t know how
2006 Apr 20
7
checking date
Radrails created a field for date
<%= product.date_available.strftime("%y-%m-%d") %>
What does this mean?
Should the definition be date or datetime? I tried both and no results
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/ed0cbb14/attachment.html
2005 Mar 15
15
Web-based Ruby Syntax Highlighter
Hi all,
Last night, I wrote a web-based syntax highlighter that takes Ruby and
produces nice HTML of the code, ready for including on web pages, or in blog
posts, or whatever. I don''t know how useful it will be for other people, but
feel free to use it. Anyway, the URL is :
http://syntax.carldr.com/
Any comments/suggestions would be gratefully received. Enjoy!
2005 Mar 10
6
problems with ActionMailer
I''m having some problems with ActionMailer and I''m hoping that someone can
help. I''ve followed the tutorial on "How To Send Emails With Action
Mailer" <URL:
http://wiki.rubyonrails.com/rails/show/HowToSendEmailsWithActionMailer >,
I''ve generated a mailer -- "notifier.rb" -- and I''ve added the following
method to the
2005 Mar 10
6
Expiring Cache Fragments and fcgi
First let me say that Rails caching is very very cool. The traffic
(and responsiveness) I''ve saved by added 10 lines of ruby code would
be enourmous, if I actually had traffic... ;)
Sweepers as observers are great, btw. Since every page of my side is
dynamic, once I did some DB optimization I''m caching the content of
the index page which was taking the bulk of the time to load
2005 Mar 10
5
dispatch.fcgi dieing randomly
Recently my application has refused to start on my production
environment. The setup is debian(unstable)/apache2/fastcgi/mysql
Rails 0.10 (upgrading to 0.10.1 as we speak)
When I first start up apache the machine grinds to a crawl starting up
the dispatch.cfi processes. It''s a VPS with 256M of ram, but still
(in addition to user time) it''s spending 30% of time in system