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: $ gem install pg Building native extensions. ...

paperclip image broken in rails 3.1rc4

I am using rails 3.1rc4 with paperclip and i cannot upload any image file with. I keep getting this error Image D:/Users/MOBILE/AppData/Local/Temp/stream20110612-3872-y7hmme-0.jpg is not...

No route matches [GET] "/users/sign_out"

Here is my actual error: No route matches [GET] "/members/sign_out" Since most people will use "users" I thought it would be more helpful to have that in the title. At any rate, I am essential...

can't activate mysql2 (~> 0.3.6), already activated mysql2-0.3.2 in Rails 3.1

I'm just trying to get the most basic of basic shell of a rails app running under 3.1, and I'm getting this weird error when I run bundle exec rake db:migrate- Please install the mysql2 adapter:...

How to set up factory in FactoryGirl with has_many association

Can someone tell me if I'm just going about the setup the wrong way? I have the following models that have has_many.through associations: class Listing < ActiveRecord::Base attr_accessible ......

Install the mysql2 gem for a specific mysql client version?

I'm trying to use the mysql2 gem with rails 3.1.0.rc6, but I'm having some problem with my mysql client. I'm getting this message when trying to start my server. Incorrect MySQL client library...

Run migrations from rails console

Is there a way to run rake commands for db:migrate and db:rollback on the console? It sucks to wait for the rails environment to load!

Rails 3.1 recommended practice for managing library javascripts

I'm curious what is the recommend approach for organizing and using library javascripts (things like Backbone, Underscore, Modernizr, etc.) in Rails. I've noticed a number of different practices...

How to debug Rails I18N lookup?

In the Rails docs there seem to be different default locations for I18N strings, depending if the I18N-lookup was initiated from a view, model / validation, controller, helper, ..., if it's a...

how to paginate records from multiple models? (do I need a polymorphic join?)

After quite a bit of searching, I'm still a bit lost. There are a few other similar questions out there that deal with paginating multiple models, but they are either unanswered or they pagainate...

Turn off verbose sql/ActiveRecord for Rails 3.1.1

Whereas the verbose feature of SQL/ActiveRecord calls is useful most of the time, I would like to turn it off in cases where I have some looping going on. Is there a way to turn it...

Rails 3.1 Asset pipeline - Why my images do not precompile for production?

When running: rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets Everything precompiles but not my /app/assets/images/* I even tried adding this to my...

Error while loading shared libraries: 'libpcre.so.0: cannot open shared object file: No such file or directory'

I just installed Passenger 3.0.11 and nginx and got this error: Starting nginx: /opt/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such...

What's the set up database on Heroku?

I have deployed my Rails 3.1 app with the MySQL database to Heroku and there everything works fine. I mean, into database are saved the chars right (seems to be used UTF charset on a databases on...

Check if a model was modified or created on before_save event

I want to check if a model is being created in the before_save callback of Rails. I also want to check if it has been modified (when updating). Thanks

Find number of months between two Dates in Ruby on Rails

I have two Ruby on Rails DateTime objects. How to find the number of months between them? (Keeping in mind they might belong to different years)

Cross-thread violation on rb_gc()

The codebase I'm working on was recently upgraded from Ruby 1.9.2 to Ruby 1.9.3 and from Rails 3.1 to Rails 3.2.2. Since I'm using RVM I simply did rvm install 1.9.3 which I would have expected...

Rails nested_form link_to_add not working when pre-building nested model instance

I'm having a rough go integrating ryanb's awesome nested_form gem into my rails 3.1.3 application. I'm afraid my Javascript skills are too limited to know whether it's my code (likely) or the gem...

Rails does not work on Lion

I changed my Mac OSX version to Lion. However I cannot create a Rails3 app. I use rvm 1.9.2 and i choose ruby 1.9.2-p290 to create Rails 3 app. Everything seems okey. When I start to create a new...

How to save pdf file inside the public folder using wicked_pdf

Right Now i am using Rails 3.0.0.i already installed the gem wicked_pdf.Now to want to save the pdf file inside the public folder.please help me.

Redirect One Controller to another Controller

I have two controllers users & movies. All, I want to do, redirect from user#something to movie#something. is it possible??

Savon HTTP::ERROR but no more information?

I am trying to configure my rails app to talk to a soap webservice using this code: client = Savon::Client.new do wsdl.document =...

How do I access Apache error logs via the Terminal in Mac OS X 10.6.8?

I am having trouble with serving up my rails app on a remote computer after upgrading from Rails 3.0 to 3.1. So I want to take a look at what exactly is going wrong when Apache attempts to start...

ruby on rails how to deal with NaN

I have read few posts regarding NaN but did not figure out how to deal with it in Ruby on Rails. I want to check a value if it is a NaN I want to replace it with Zero(0). I tried the...

Rails Alpha2 country to Real country name

I am using country gem https://github.com/hexorx/countries and trying to get the the country name from alpha2 country names. but it comes as [object object]. here is my code. render :json =>...

Gemfile.lock contains merge conflicts

I just ran git push origin master and got this error after trying to run rails s: Your Gemfile.lock contains merge conflicts. Run `git checkout HEAD -- Gemfile.lock` first to get a clean...

Why ExecJS constantly uses 100% CPU?

I'm using Ruby 2.2.4 and Rails 4.2.5 and Capistrano to deploy, but after my latest commit suddenly server always uses 100% CPU. I used htop and saw command nodejs tmp/execjs use all the CPU. [CPU...

Detected sqlite3 gem which is not supported on Heroku. But it is not on the Gemfile

In my Gemfile I commented the line gem 'sqlite3' and I ran bundler update and bundler install and git add . and git commit -m "...". But the error keeps popping up when I try git push heroku...

Heroku Deployment - Rails 6.1.3 - Bundle install failing - Gemfile.lock platform addition

I am trying to deploy a simple Ruby on Rails web app using Heroku. When I attempt to deploy the web app, I get a bundler error saying the correct platform is not within the Gemfile.lock Here is...

Error while running bundle update after doing git clone

I'm using window operating system for ruby on rails application. I just clone the git repository which is a ruby on rails application. But, when I do bundle update it shows this error libv8-node...