Updated: Rails3 Custom Environment Variables

Posted by Jason Noble on 12/03/2011 in ruby on rails |

A while back, I wrote a blog post on adding custom environment variables to Rails3. This has gotten much easier with a change made by Jose Valim back in March. The change allows you to create your own custom configuration variables like so: [ruby] # config/environments/development.rb Demo::Application.configure do […] config.json_url = "http://www.domain.com" […] end [/ruby] […]


Rails3 Custom Environment Variables

Posted by Jason Noble on 02/14/2011 in ruby, ruby on rails |

I recently saw a question on Stack Overflow regarding custom variables that have different values based on which environment you are running for Rails. It turns out it’s very easy to accomplish. [ruby] # config/initializers/configuration.rb class Configuration class << self attr_accessor :json_url end end [/ruby] This gives you access to a Rails variable called Configuration.json_url. […]

Pushing Depot to Heroku

Posted by Jason Noble on 10/31/2010 in ruby on rails |

I’m working my way through Agile Web Development with Rails, 4th edition by Sam Ruby. I just finished up with Chapter 6: Creating the Application. It’s working fine on my machine, but I wanted to push it to Heroku. Here’s how I did it: [plain] echo "gem ‘heroku’" >> Gemfile bundle install git init git […]

Tags: , ,


Playing around with Conductor by DHH

Posted by Jason Noble on 10/30/2010 in ruby on rails |

A while back, I saw that DHH had published a rails engine called Conductor. I added it to my list of things to look at and tonight, I got some time to take a look. I’m using RVM with 1.9.2p0 and rails 3.0.1. [plain] rails new conductor && cd conductor [/plain] I edited my Gemfile […]

Tags: ,

Making TextMate recognize .html.erb files

Posted by Jason Noble on 09/21/2008 in ruby, ruby on rails, textmate |

I’m using TextMate to edit some Ruby on Rails code. I noticed that when I edit the view pages (i.e. index.html.erb) it does not do syntax highlighting. It turns out this is because the Ruby on Rails TextMate bundle thinks that ruby view pages are .rhtml, which is the old Ruby on Rails format. You […]

Allow rails users to login via vsftpd

Posted by Jason Noble on 09/02/2008 in FreeBSD, pam, postgres, ruby on rails, vsftpd |

So you’ve installed Ruby on Rails with Postgres, and now you want to allow your users to login to your server via FTP. First we need to install our FTP server. (In the config window, I left the defaults) [text] freebsd-vm# cd /usr/ports/ftp/vsftpd freebsd-vm# make install cd /usr/ports/ftp/vsftpd && make config; […] ports included in […]


Installing Ruby on Rails in FreeBSD with Postgres

Posted by Jason Noble on 09/02/2008 in FreeBSD, postgres, ruby, ruby on rails |

After setting up a minimal FreeBSD install, I want to get Ruby on Rails up and running. Let’s see what’s available in the ports tree. [text] freebsd-vm# make search key=gem | grep Path: | grep ruby Path: /usr/ports/audio/rubygem-mp3info Path: /usr/ports/benchmarks/rubygem-railsbench Path: /usr/ports/databases/ruby-dbd_pg Path: /usr/ports/databases/ruby-rdbc1 Path: /usr/ports/databases/rubygem-activerecord […] Path: /usr/ports/devel/ruby-gemfinder Path: /usr/ports/devel/ruby-gems Path: /usr/ports/devel/rubygem-activesupport […] Path: […]

Copyright © 2008-2024 Jason Noble's Technical Adventures All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.