GEM is a pretty cool packaging system for Ruby apps. Take a look to http://rubygems.org. Usually it is installed together with ruby. You can update your gems with this command: sudo gem1.9 update –system Here is the user guid: http://docs.rubygems.org/read/book/1
Category Archives: Ruby
Installing Ruby on Mac OS X
On Mac OS X Ruby 1.8.X is already pre-installed. But if you want to have the newest version 1.9.X you have to install it again. I assume that you installed already XCode and MacPorts on your machine. Than you have update your MacPorts sudo port selfupdate All right. Now you can install the newest version.Continue reading “Installing Ruby on Mac OS X”
.gitignore
If you want that git is ignoring some files for you you just have to create the “.gitignore” file in your project root. Here you can add all the files you don’t want have in your git repository. For example some meta files from IntelliJ IDEA. *.iml *.ipr *.iws .idea/
Single Sign-On with Facebook & Ruby on Rails
There are over 400 Million people on earth with a Facebook Account. From this point of view it makes absolute sense to offer a Single Sign-On with Facebook. Facebook offers a Login via OAuth 2.0. The Facebook documentation for the Authentication process you can find here: http://developers.facebook.com/docs/authentication/. Before you are using the API from Facebook youContinue reading “Single Sign-On with Facebook & Ruby on Rails”
HTML Upload to Amazon S3 with Ruby on Rails
This Blog Post will demonstrate how to build a HTML file upload for images with Ruby on Rails and store the images on Amazon S3 Cloud Storage. I assume that you are familiar with Ruby on Rails and RubyGems. For the connection to Amazons S3 Storage System we will use the gem “aws-s3”. To useContinue reading “HTML Upload to Amazon S3 with Ruby on Rails”
uninitialized constant ::XPath
I got this Exception today: uninitialized constant ::XPath The solution is not to use XPath alone. Use instead “REXML::XPath”.
HTTParty
The default HTTP libary in Ruby is pretty ugly. I don’t like it. I found HTTParty on rubygems and this is really easy to use. It is much better than the default HTTP API from ruby. Just add this to your Gemfile: gem ‘httparty’, ‘0.7.4’ With one line you can fetch a site via GET.Continue reading “HTTParty”
Generate Model with Rails
This command generates a Comment Model. rails generate model Comment commenter:string body:text post:references
Generate Migration with Rails
Note for me! With this command it is possible to generate a migration: rails generate migration add_email_uniqueness_index This will generate a file like this: db/migrate/<Timestamp>add_email_uniqueness_index.rb With this command all migration scripts will be executed. rake db:migrate
Create a GIT Repository
Just go into the directory you want to have version control for and type in: git init This will create an empty git repository on your hard disk. With this command git add . you can add all files in the directory to the git repository. And with git commit -a -m “init” you canContinue reading “Create a GIT Repository”
Creating a branch with git
Just go into the root directory of your project and type in: git checkout -b branch1 That’s all. Now your created a new branch with the name “branch1”. Your working directory is now the branch. You can commit your changes like this: git add . git -a -m “my changes” After the commit you canContinue reading “Creating a branch with git”
RVM (Ruby Version Manager) – broken !?
Yesteday I installeld RVM on my Mac. RVM is a version Manager for Ruby. I wanted install ruby 1.9.2 with rvm. rvm install 1.9.2 After a while I got this Message: /Users/robert/.rvm/scripts/manage: line 135: syntax error in conditional expression: unexpected token `;’ /Users/robert/.rvm/scripts/manage: line 135: syntax error near `;’ /Users/robert/.rvm/scripts/manage: line 135: ` if [[Continue reading “RVM (Ruby Version Manager) – broken !?”
First Steps with Ruby
I am a Java guy. I have nearly 10 years experience with Java. I have build high scale able Web Apps with Java, Spring, Struts, JSF, Hibernate, JDBC, Ant, Maven2, JUnit and some other crazy Frameworks. Now I want to try out something new. I am playing around with Ruby, Rails, Gem, Rake and allContinue reading “First Steps with Ruby”