Kategorien
Entwicklung

Using pow with rvm 1.19

Since rvm 1.19.0 there is a alternative way to specify a project related ruby version and gemset through the files .ruby-version and .ruby-gemset instead of the still valid use of the .rvmrc file. The .rvmrc is of course as before the default configuration for rvm, but it requires to be trusted, as it could contain any shell command. Further the recently supported files are compatible with other ruby version managers like rbenv or chruby.

So after an upgrade of rvm a message like below would be displayed if you enter a directory which contains a .rvmrc.

You are using ‚.rvmrc‘, it requires trusting, it is slower and it is not compatible with other ruby managers,
you can switch to ‚.ruby-version‘ using ‚rvm rvmrc to [.]ruby-version‘
or ignore this warnings with ‚rvm rvmrc warning ignore /Users/dboeckma/workspace/mymine/bookmarks/.rvmrc‘,
‚.rvmrc‘ will continue to be the default project file in RVM 1 and RVM 2,
to ignore the warning for all files run ‚rvm rvmrc warning ignore all.rvmrcs‘.

Like the messages says you could switch to the new configuration with the given command.

rvm rvmrc to .ruby-version

This results in the following two files. First the .ruby-version in which the ruby version is defined.

ruby-2.0.0-p0

Second the .ruby-gemset with the gemset that should be used in conjunction with the ruby version.

octopress

Surely, the ruby version and gemset can differ in your files. 😀

So far so good. The problem comes with the next try to use pow with the new configuration files. The recommended .powrc, which comes with pow, only considers the .rvmrc file, which not exists any longer. As a result pow uses the wrong default system ruby version and gemset. With a slightly enhanced .powrc file, like the one below, it will run with both variations.

if [ -f "$rvm_path/scripts/rvm" ]; then
  source "$rvm_path/scripts/rvm"

  if [ -f ".ruby-version" ]; then 
    if [ -f ".ruby-gemset" ]; then
      rvm use `cat .ruby-version`@`cat .ruby-gemset`
    else
      rvm use `cat .ruby-version`
    fi
  elif [ -f ".rvmrc" ]; then
    source ".rvmrc"
  fi
fi

You can see the modifications also as gist on github.

Kategorien
Entwicklung

Hello Ruby! Hello Ruby on Rails!

Recently I took a closer look at Ruby and Ruby on Rails. Therefore I searched the web for some usefuly documentation to get a quick start. Here are the results.

Programming Ruby – The Pragmatic Programmer’s Guide is a free book about Ruby linked on the Ruby documentation page. Quite old but for most properties of the language suitable. Of course, there are some more useful links on the Ruby documentation page like the Ruby Core Reference or the Ruby Standard Library Reference, which lead to the Ruby documentation project.

O’Reilly has two free german books available on the internet. The first is O’Reilly Praxiswissen Ruby about the language Ruby and the second is O’Reilly Praxiswissen Ruby On Rails about Ruby on Rails. The last is mainly about Ruby on Rails 2 and for starters highly likely not interesting since Ruby on Rails 3 was released.

Ruby on Rails Tutorial is a great book about Ruby on Rails 3, which is free available on the internet. It is also purchasable as printed version or as pdf version on the site. In the book you will create a twitter simliar page by a test driven approach and with source code management by git. A short introduction to Ruby is certainly present in the book. On the side of Ruby on Rails can be found also some useful stuff. Two of them are the Ruby on Rails documentation and the Ruby on Rails tutorials.

Lastly some more links:

Kategorien
Entwicklung

Welcome to the world of git

Well, now I’am using git about 2 years as my favourite Source Code Management (SCM). In this time I have collected some links that may help beginners to get into the world of git and Distributed Version Control System (DVCS).

As apparent from the title the links will mainly cover topics referring to git, but I will not let mercurial unmentioned. Mercurial is also a DVCS which features are comparable to git. It’s no loss to take a closer look at it, too.

Of course, there is the homepage of git with plenty of useful stuff – including git itself, but I think a good starting point to get familiar with the workflow off a DVCS and certainly especially git
is GIT±IMMERSION. It shows in a nice step by step tutorial the common usage of git. As reference for the several git commands it is worthwhile to look at GIT Reference. Another useful page which arranges tips by topics is git ready. Last but not least there is a wonderful free book call Pro Git available online. Additional the german podcast named Chaos Radio Express has a episode „Verteilte Versionskontrollsysteme“ about DVCS and the in parts funny tech talk from Linus Torvalds.

Linus Tovarlds Tech Talk: on git at 08:30

If you actually like cvs – you shouldn’t be here. You should be in some mental institution or somewhere else.

Some more advanced is the a-successful-git-branching-model by Vincent Driessen. This model describes a way to manage releases of a software with a branching strategy. The project gitflow on github extends git with some scripts, which simplifies to follow the model. By the way github, bitbucket and gitorious are some of the hosters for git repositories and useful for collaborate working, if you not want to set up your own server. I think you will see sooner or later that DVCS offer more workflows to work together as via a centralized server. Hope this short overview will help some one to get faster into the git world.

For a better overview all links in one list: