by sandipransing
Heroku is readonly file system hence write operations can only be done inside tmp directory.
Asset compilation on heroku can be handled in different ways
#1. compiling locally and placing inside assets directory
RAILS_ENV=production bundle exec rake assets:precompile
#2. It compiles assets while slug compiles
#3. Run time asset compilation
# It compiles assets for every rails request if it notifies assets got modified
# config/application.rb
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.assets.prefix = Rails.root.join('tmp/assets').to_s
# config/environments/production.rb
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
Note: write operation made inside tmp directory can not make any guarantee of being persisted hence be careful while using.
Read More…
by sandipransing
Install RVM first
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvminstaller)
rvm list known
# MRI Rubies
[ruby-]1.8.6-head
[ruby-]1.8.7[-p352]
[ruby-]1.9.3-head
ruby-head
# JRuby
jruby-1.2.0
jruby-head
# Rubinius
rbx-1.0.1
rbx-2.0.0pre
# Ruby Enterprise Edition
ree-1.8.6
ree-1.8.7-head
Install ruby 1.9.3
rvm install 1.9.3-head
rvm gemset create rails311
rvm use 1.9.3-head@rails311 --default
gem install rails -v3.1.1 --no-rdoc --no-ri
gem install heroku
gem install rb-readline
Create new rails project
rails new cdc -m http://railswizard.org/b22092a4358bbebb3a46.rb -J -T
Heroku Deployment Done
http://railsblank.heroku.com/ (production)
Local System nginx-passenger setup
gem install passenger
rvmsudo passenger-install-nginx-module
If you find pcre download error then make sure you libpcre-dev pkg
installed on your system otherwise install it and re-run
sudo apt-get install libpcre3-dev
Nginx Configuration
http {
passenger_root /home/sandip/.rvm/gems/ruby-1.9.3-head@rails311/gems/passenger-3.0.9;
passenger_ruby /home/sandip/.rvm/wrappers/ruby-1.9.3-head@rails311/ruby;
server {
listen 80;
server_name railsblank.local;
root /home/sandip/railsblank/public;
rails_env development;
passenger_enabled on;
}
git source code
git clone git://github.com/sandipransing/rails_blank.git
Read More…