Friday, December 12, 2014

WARNING: VCR::RSpec::Macros is deprecated. Use RSpec metadata options instead `:vcr => vcr_options`

Delete the line: config.extend VCR::RSpec::Macros in rspec_helper.rb or rails_helper.rb.

VCR Deprecations

Friday, December 05, 2014

Upgrading from Rails 4.1.4 to Rails 4.1.8

Problem when upgrading from Rails 4.1.4 to Rails 4.1.8

rails -v
Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to `bundle binstub rails` to work around a system/bundle conflict.
Rails 4.1.8


Fix:
$rm -rf bin/*
$bundle exec rake rails:update:bin
zepho-mac-pro:lafon zepho$ rails -v
Rails 4.1.8


Thursday, November 27, 2014

Monday, November 24, 2014

Deploying a Rails App on Google App Engine

Deploying a Rails Webapp on GAE should be a piece of cake right? Due to lack of good documentation, it is not that easy. I had to dig around to find the versions of the software installed for Ruby Stack One-Click Deploy.

Here is some useful information to access installed software components.
Apache web server:  

Configuration directory: /etc/apache2
Default website directory: /var/www
Command to start Apache web server: sudo service apache2 start
Command to stop Apache web server: sudo service apache2 stop

Passenger:

Help command: passenger --help
Install directory: /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.48

MySQL:

Command to access MySQL: mysql -u root -p
Command to start MySQL service: sudo service mysql start
Command to stop MySQL service: sudo service mysql stop

RVM, Ruby and Rails:

RVM Help command: rvm
Rails help command: rails -h
RVM install directory: /usr/local/rvm
Ruby install directory: /usr/local/rvm/src/ruby-2.1.1
Rails install directory: /usr/local/rvm/gems/ruby-2.1.1/gems/rails-4.1.4

Git:
Help command: git --help

Saturday, November 22, 2014

bin/rails:6: warning: already initialized constant APP_PATH

I was getting this error in Rails 4.2 beta when I started the rails server. Solution: run : rake rails:update:bin from rails project directory.

git Illegal instruction: 4 mac 10.7.5

Download the git for Mac 10.7.5  and restart your terminal.

Tuesday, November 18, 2014

Evolution of Rails from 1.0, 2.0 and 4.0

Rails 1.0



Rails 2.0



Rails 4.0



Friday, November 14, 2014

Stripe API Capybara Test Failures

I was getting Stripe::InvalidRequestError: You must supply either a card or a customer id error. To fix this, make sure js is true in your integration test like this:

feature 'Guest Checkout' do
  scenario 'Complete purchase of one product', js: true do
    visit products_show_path
    click_link 'Buy Now'
   
    fill_in "Card Number", with: '4242424242424242'  
    page.select '10', from: "card_month"
    page.select '2029', from: 'card_year'
    click_button 'Buy Now'
   
    expect(page).to have_content('Receipt')
  end
end