Skip to content

Instantly share code, notes, and snippets.

@travisvalentine
Created April 15, 2012 14:20
Show Gist options
  • Save travisvalentine/2393098 to your computer and use it in GitHub Desktop.
Save travisvalentine/2393098 to your computer and use it in GitHub Desktop.
Fix for Heroku in production, changing Gemfile and Rakefile
# Fix for error: `ActionView::Template::Error ('twitter/bootstrap.less' wasn't found.`
# Gems inside of assets aren't required in production, but we need bootstrap in production
# So pull the bootstrap gem outside of assets
# You also need to remove `app/assets/stylesheets/bootstrap.css.less` if you haven't already.
gem 'twitter-bootstrap-rails'
group :assets do
..
end
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
# If you're not seeing errors and nothing is working, be sure to have migrated your db in heroku
# After pushing to git, pushing to heroku, run `heroku run rake db:migrate`
# You can also run `heroku run rake db:seed` if you have a `seeds.rb`
# Fix for error: `no such file to load -- rspec/core/rake_task`
# Heroku builds apps without the Gemfile's development/test groups, which is where we have rspec installed
# So when Heroku runs the Rakefile it expects rspec even though it doesn't exist in production
# That's why we need to add an unless to make sure we only run rspec outside of production
unless Rails.env.production?
begin
require 'rspec/core/rake_task'
task :default => :spec
RSpec::Core::RakeTask.new("spec:acceptance") do |t|
t.rspec_opts = "--tag acceptance"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment