All Questions

129
votes
2answers
25986 views

Ignoring timezones altogether in Rails and PostgreSQL

I'm dealing with dates and times in Rails and Postgres and running into this issue: The database is in UTC. The user sets a time-zone of choice in the Rails app, but it's only to be used when gettin...
261
votes
11answers
128403 views

Best way to load module/class from lib folder in Rails 3?

Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore, what would be the best way to load them? From github: A few changes were done in this commit: Do not auto...
582
votes
35answers
206432 views

Can't find the 'libpq-fe.h header when trying to install pg gem

I am using the Ruby on Rails 3.1 pre version. I like to use PostgreSQL, but the problem is installing the pg gem. It gives me the following error: demonchand@system-001:~/exercise/personal/pro$ gem i...
195
votes
15answers
60245 views

Repairing Postgresql after upgrading to OSX 10.7 Lion

I recently upgraded to OSX 10.7, at which point my rails installation completely borked when trying to connect to the psql server. When I do it from the command line using psql -U postgres it wo...
218
votes
11answers
114279 views

Rails - Could not find a JavaScript runtime?

I created a new Rails project using rails 3.1.0.rc4 on my local machine but when I try to start the server I get: Could not find a JavaScript runtime. See here for a list of available runtimes. (ExecJ...
155
votes
10answers
79495 views

Best way to add page specific JavaScript in a Rails 3 app?

Rails 3 has some unobtrusive JavaScript which is pretty cool. But I was wondering what the best way is to include additional JavaScript for a particular page. For example, where I might have previou...
137
votes
14answers
58963 views

Can't find the PostgreSQL client library (libpq)

I'm trying to install PostgreSQL for Rails on Mac OS X 10.6. First I tried the MacPorts install but that didn't go well so I did the one-click DMG install. That seemed to work. I suspect I need to in...
146
votes
13answers
94767 views

ActiveRecord OR query

How do you do an OR query in Rails 3 ActiveRecord. All the examples I find just have AND queries. Edit: OR method is available since Rails 5. See ActiveRecord::QueryMethods
76
votes
29answers
80100 views

rails error, couldn't parse YAML

After updating the gems I've got this: /home/megas/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse YAML at line 182 column 9 (Psych::SyntaxError) from /home/meg...
368
votes
29answers
112867 views

No route matches "/users/sign_out" devise rails 3

I've installed devise on my app and applied the following in my application.html.erb file: <div id="user_nav"> <% if user_signed_in? %> Signed in as <%= current_user.email ...

Previous Next