Top "Ruby-on-rails-4.2" questions

For issues specific to version 4.2 of Rails.

Rails 4 - Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded

In my gemfile I have: gem 'mysql2' My database.yml is as follows: default: &default adapter: mysql2 database: &…

ruby-on-rails ruby-on-rails-4 ruby-on-rails-4.1 mysql2 ruby-on-rails-4.2
How to change the default binding ip of Rails 4.2 development server?

After upgrading our team's rails application to 4.2, as the release note mentioned, the default ip rails server binds to is …

ruby-on-rails ruby-on-rails-4.2
Why doesn't Rails autoload classes from app/services?

I'm working on a Rails 4.2 app and have just added app/services/fetch_artists.rb to the structure. Inside this …

ruby-on-rails autoload ruby-on-rails-4.2
No such file or directory @ rb_sysopen - public/receipts/416981.pdf

Below on line no. 2, I am getting this error: Errno::ENOENT in OrdersController#print def generate_receipt(filename = nil, current_…

ruby-on-rails-4.2
Add nullable foreign key in Rails

Referencing to Rails 4.2 add_foreign_key support: # add a foreign key to `articles.author_id` referencing `authors.id` add_foreign_…

ruby-on-rails ruby ruby-on-rails-4 rails-activerecord ruby-on-rails-4.2
Helper methods for models in Rails

Is there a proper place for helper methods for models in Rails? There are helper methods for controllers and views, …

ruby-on-rails ruby ruby-on-rails-4 model ruby-on-rails-4.2
El Capitan upgrade: Library not loaded: /usr/local/lib/libmysqlclient.18.dylib

Error: /Users/askar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysql2-0.3.20/lib/mysql2.rb:31:in `require': dlopen(/Users/askar/.rbenv/…

mysql ruby macos osx-elcapitan ruby-on-rails-4.2
can't connect localhost:3000 ruby on rails in vagrant

I tried to connect localhost:3000 in windows rails server is running in vagrant(ubuntu 14.10) portforwarding is done when, I tried …

ruby-on-rails ruby ruby-on-rails-4 vagrant ruby-on-rails-4.2
How can I get ActiveJob to enqueue jobs in Sidekiq on Heroku when called from the app (not the console)?

I'm running Rails 4.2 on Heroku (cedar), Ruby 2.1.6 I've got Sidekiq running locally on Redis with Foreman, and in my app …

ruby-on-rails heroku sidekiq ruby-on-rails-4.2
rails server cannot start; getaddrinfo: nodename nor servname provided, or not known (SocketError)

I have not found a solution to the problem, however someone did already ask about the same problem a few …

ruby-on-rails ruby osx-yosemite ruby-on-rails-4.2 ruby-2.2