Posts Tagged Stack

Rails 3.1 on Heroku, TLDR Version

Create the app

  1. If not installed, install PostgreSQL
  2. rails new app_name -T -d=postgresql
  3. cd app_name/
  4. rvm --create --rvmrc 1.9.2@app_name
  5. rvm rvmrc trust
  6. Edit .Gemfile
  7. bundle install
  8. createuser -P -S -R -d app_name (no to ‘Superuser’ and ‘Create roles’, yes to ‘Create databases’)
  9. rake db:create
  10. Create procfile in app root.
  11. foreman start and check http://0.0.0.0:5000/

Push to Github

  1. Edit .gitignore
  2. git flow init
  3. git add .
  4. git commit -m 'Project skeleton'
  5. Create app_name on Github
  6. git remote add origin git@github.com:JohnPlummer/app_name.git
  7. git push -u origin develop
  8. git push -u origin master

Push to Heroku

  1. heroku create app-name --stack cedar
  2. git flow release start '0.0.1'
  3. git flow release finish '0.0.1'
  4. git push --all
  5. git push heroku master
  6. heroku run rake db:seed
  7. heroku open

, , , , , , ,

No Comments

Installing WordPress on your Mac for Development

The Stack

To run WordPress locally you will need Apache, MySQL, and PHP installed. Although OS X comes with some of these it is more convenient to use MAMP. MAMP comes in a free version and a Pro version, for my purposes the free version should be fine.

Installation is just copying a folder from the disc image to your applications folder and removal is just a case of deleting the folder. Once the folder has been copied just start MAMP which will start the servers and open the home page on port 8888.MAMP

From the preferences > Apache pane set the document root to wherever you want to put your sites. I set mine to ~/dev/sites/.

The Database

Click on open start page on the MAMP dialogue then click on phpMyAdmin, enter a database name for your WordPress database then click on create. Click on privileges and create a new user with full privileges for the database.

WordPress

Create a subdirectory for your new web site in your sites directory, download WordPress from wordpress.org and unzip the contents of the download into the subdirectory.

Rename the file wp-config-sample.php to wp-config.php then edit it to fill in the database details and change the salts and keys.

Navigate to http://localhost:8888/ and you should see the subdirectory, click the link and you should get taken to the WordPress install page (if you get error connecting to database it is likely that either your database server is not running of there is an error in your wp_config.php). Fill in the blog title, username, password, and email, hit submit and you are done.

, , , , , , , , , , ,

2 Comments

Learning Ruby (on Rails)

Most of my programming career has revolved around Microsoft technologies, starting with Visual Basic 3, up through the various versions to VB.Net, then switching to CSharp shortly after DotNet came out of beta.

I think I know the MS development stack fairly well and I like the direction they are moving in with the likes of MVC3 and Razor, Nuget etc. but it seems a fair amount of this ‘direction’ may be coming from the Rails community.

I have decided to give myself 2 weeks to ‘learn’ Rails, although I may get distracted by the Christmas holidays (and the fact that we will have an extra 6 kids and 3 adults staying with us for 2 weeks) and will record some of it here.

I have done a little research in preparation and bought a couple of ebooks from the prags:

They seem to be considered ‘definitive’ and cover the current versions of Rails (3.0.3) and Ruby (1.9.2).

The only other purchase I am likely to make is an IDE or editor. I code on a Mac, even when using Visual Studio so I have a few more options than most Windows users. The recommendation seems to be that, if you are on Windows, install a Linux VM for Ruby development. The favourite environment for the Mac looks to be Textmate although there are a few IDEs available such as JetBrain’s RubyMine and Aptana Studio, both of these are available for Windows, OS x, and Linux. I am a fan of JetBrain’s Resharper so will try RubyMine, the trial is 30 days so no need to make a purchase decision yet.

Other references that I expect to find useful over the next 2 weeks are:

, , , , , , , , , , , , , , , , , , , , , , ,

1 Comment