Victor Hugo Bernardes de Souza

  • Aleatório
  • Arquivo
  • RSS
  • Ask me anything

You Only Live Up to the Standards You Set

While I’m not one to advocate many personal development hacks, there is one

  • Há 1 mês
  • Comments
  • Link permanente
  • Share
    Share on Tumblr
itsmoh:

Do something you have never done before.
Pop-upView Separately

itsmoh:

Do something you have never done before.

  • Há 6 meses > itsmoh
  • 42
  • Comments
  • Link permanente
  • Share
    Share on Tumblr
Pop-upView Separately
    • #linux
    • #joke
  • Há 9 meses
  • 1
  • Comments
  • Link permanente
  • Share
    Share on Tumblr

How to install Ruby 1.9.2, Rails 3, PostgreSQL, Git and Heroku on Ubuntu 11.04

This post is a copy of a question that I answered some days ago on AskUbuntu.com and is my first english post.

I think if you follow this instructions you won’t have problems.

1- First install RVM

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) 

2- After, you have to put this snippet on your .bashrc or .bash_profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

3- Install Ruby 1.9.2 via RVM

rvm install ruby-1.9.2-p180 #NEVER USE SUDO WITH RVM

4- Set Ruby 1.9.2 as your default version:

rvm use 1.9.2-p180 --default

5- Now, you have to install PostgreSQL DB, change password from user ‘postgres’ and restart PostgreSQL server.

sudo apt-get install postgresql-8.4
sudo -u postgres psql template1
ALTER USER postgres with encrypted password 'your_password';
sudo /etc/init.d/postgresql restart

6- Installing GIT:

sudo apt-get install git-core git-gui git-doc

7- Finally, install gems Rails, Heroku e PG(PostgreSQL):

gem install rails pg heroku

I hope this may have helped you! :)

    • #ruby
    • #rails
    • #git
    • #heroku
    • #AskUbuntu.com
  • Há 9 meses
  • 1
  • Comments
  • Link permanente
  • Share
    Share on Tumblr
'\x3cdiv id=\x22photoset_26094575468\x22 class=\x22html_photoset\x22\x3e \x3ciframe id=\x22photoset_iframe_26094575468\x22 class=\x22photoset\x22 scrolling=\x22no\x22 frameborder=\x220\x22 height=\x221069\x22 width=\x22500\x22\x0a style=\x22border:0px; background-color:transparent; overflow:hidden;\x22 src=\x22http://vhbsouza.tumblr.com/post/26094575468/photoset_iframe/vhbsouza/tumblr_m662ptWnMI1qfxwn2/500/false\x22\x3e\x3c/iframe\x3e\x3c/div\x3e'

(via nerdpride)

  • Há 11 meses > thepatientfrog
  • 3281
  • Comments
  • Link permanente
  • Share
    Share on Tumblr
'\x3cdiv id=\x22photoset_19990276514\x22 class=\x22html_photoset\x22\x3e \x3ciframe id=\x22photoset_iframe_19990276514\x22 class=\x22photoset\x22 scrolling=\x22no\x22 frameborder=\x220\x22 height=\x22501\x22 width=\x22500\x22\x0a style=\x22border:0px; background-color:transparent; overflow:hidden;\x22 src=\x22http://vhbsouza.tumblr.com/post/19990276514/photoset_iframe/vhbsouza/tumblr_lrtzmqoY911qc3ju8/500/false\x22\x3e\x3c/iframe\x3e\x3c/div\x3e'

(via )

    • #nerd
    • #star wars
  • Há 1 ano > jamesvega
  • 515
  • Comments
  • Link permanente
  • Share
    Share on Tumblr
Se algum dia alguém fechar as portas para você não se desespere, pule a janela, você não é aleijado.
Carro Velho (YouTube)
    • #quotes
    • #carro velho
    • #pensamentos
  • Há 1 ano
  • Comments
  • Link permanente
  • Share
    Share on Tumblr


  • Há 1 ano
  • Comments
  • Link permanente
  • Share
    Share on Tumblr

Write in C (by albertveli)

  • Há 1 ano
  • Comments
  • Link permanente
  • Share
    Share on Tumblr

Deploying a Sinatra + DataMapper + SQLite app to Heroku

yamilurbina:

Recently I followed the excellent Nettuts’ session on Singing with Sinatra, and I learned a lot about Rack-only apps.

I pushed the app to Heroku and all I was getting was “Application Error”. I found out that Heroku only uses PostgreSQL as database, so SQLite will not work at all. This is what you should do:

a) Make sure you have a .gems file on the top folder with all the gems you need:

sinatra
data_mapper
rack-flash
sinatra-redirect-with-flash
builder
dm-postgres-adapter

Did you notice the dm-postgres-adapter at the end?. That gem is ABSOLUTE NECESSARY if you coded your app using SQLite and DataMapper and you want to push it to Heroku. I repeat. ABSOLUTE NECESSARY.

b) We also need a configure.ru file at the top folder:

require 'your_sinatra_app_file_name'
run Sinatra::Application

c) On your Sinatra file (the one that has all the code) we need to tell DataMapper which database to use:

# Setting up the database
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/mydatabase.db")

The part ENV['DATABASE_URL'] is used by Heroku to assign a database to our app. If we are developing locally, we just use mydatabase.db, which is SQLite. Got it?

d) Finally, we push the DB to Heroku:

heroku db:push sqlite://mydatabase.db #assuming you are on your app directory

Our SQLite database will be translated to a PostgreSQL database automatically. No hassle!

Just push it (the app, I mean) and there you go. It will work. You are a hero.

    • #deploy
    • #git
    • #sinatra
    • #datamapper
    • #sqlite
    • #postgresql
    • #push
    • #gem
    • #ruby
    • #rack
  • Há 1 ano > yamilurbina
  • 11
  • Comments
  • Link permanente
  • Share
    Share on Tumblr
← Mais recentes • Mais antigas →
Página 1 de 6

Sobre

Avatar Open Source enthusiast, Rotaractor, Mozilla Campus Rep, Developer, Indie Rock lover ...

Me, Elsewhere

  • @vhbsouza on Twitter
  • Facebook Profile
  • vhbsouza on Flickr
  • vhbsouza on Last.fm
  • My Skype Info
  • vhbsouza on github

Spread my Tumblr

Spread Mozilla

Links Recomendados

  • Blog do Bruno Gualda
  • Blog do Bruno Anhaia

I Dig These Posts

Ver mais →
  • Foto via red1332ishere

    Awesome derivative art is awesome.

    Foto via red1332ishere
  • Foto via itsmoh

    Do something you have never done before.

    Foto via itsmoh
  • Postagem via mnewt
    Add Code Syntax Highlighting to any page in "Two" Lines
    Background

    A while back I wrote a brief post in which I shared some simple code to...

    Postagem via mnewt
  • Foto via cjwho

    architectual photography by nick frank

    Foto via cjwho
  • Foto via nerdpride
    Foto via nerdpride
  • RSS
  • Aleatório
  • Arquivo
  • Ask me anything
  • Celular
  • Licença Creative Commons

Effector Theme by Carlo Franco.

Desenvolvido por Tumblr