Updated: Rails3 Custom Environment Variables
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
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
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 […]
Playing around with Conductor by DHH
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 […]
Making TextMate recognize .html.erb files
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
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
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: […]