Ruby on Rails is an open-source web development framework written in Ruby. Ruby on Rails follows the principle of convention over configuration, freeing you from having to re-invent things to stay productive. Ruby on Rails 4.0 is the latest edge version available.
11
votes
1answer
3k 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 ...
146
votes
9answers
56k 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 ...
147
votes
15answers
44k 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 ...
62
votes
26answers
44k 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 ...
118
votes
15answers
82k views
Installing mysql2 gem for Rails 3
I am having some problems when trying to install mysql2 gem for Rails 3. When I try to install it by issuing "bundle install" command or "gem install mysql2" it gives me following error "Error ...
128
votes
8answers
27k views
Undefined method 'task' using Rake 0.9.0
I just updated Rake to the latest version (0.9.0.beta.4) and the rake command ends up with the following error message:
rake aborted!
undefined method `task' for ...
38
votes
6answers
49k views
Facebook how to check if user has liked page and show content?
I am trying to create a Facebook iFrame app. The app should first show an image and if the user likes the page, he will get access to some content.
I use RoR, therefore I can't use the Facebook PhP ...
226
votes
9answers
22k views
How to disable logging of asset pipeline (sprockets) messages in Rails 3.1?
Sprockets tends to be quite verbose in the (dev) log by default under Rails 3.1 (RC1):
Started GET "/assets/application.css" for 127.0.0.1 at 2011-06-10 17:30:45 -0400
Compiled ...
202
votes
25answers
39k 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 ...
77
votes
7answers
22k views
Remove ActiveRecord in Rails 3
Now that Rails 3 beta is out, I thought I'd have a look at rewriting an app I have just started work on in Rails 3 beta, both to get a feel for it and get a bit of a head-start. The app uses MongoDB ...
72
votes
7answers
20k 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 JS for a particular page.
For example, where I might have previously ...
93
votes
5answers
36k views
How to fix the uninitialized constant Rake::DSL problem on Heroku?
I am getting errors similar to the ones in these questions, except mine are occuring on Heroku:
2011-05-30T09:03:29+00:00 heroku[worker.1]: Starting process with command: `rake jobs:work`
...
97
votes
8answers
38k views
Can't find the 'libpq-fe.h header when trying to install pg gem on ubuntu
I am using 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 install pg
...
53
votes
6answers
24k 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. ...
39
votes
3answers
20k views
Build vs new in Rails 3
In the Rails 3 docs, the build method for associations is described as being the same as the new method, but with the automatic assignment of the foreign key. Straight from the docs:
...