Quick thoughts on things
|
Written by Chintan Rajyaguru
|
|
Wednesday, 21 February 2007 |
Rails framework is typically installed and managed using a package manager called RubyGems. If you use Linux, you are likely to be familiar with the concept of package manager: apt-get on Debian, YAST on SUSE and so on.
RubyGems
To install rails, the first thing you need to do is install RubyGems. You can download RubyGems from here. At the time of this writing, v0.9.2 is the latest version of RubyGems. Once downloaded, unzip the file, which will create a directory rubygems-0.9.2. Change to that directory, su to root and issue ruby setup.rb command. If you downloaded the version I pointed to in the link above and a newer version is available, you can upgrade to a newer version of RubyGems using the tool itself. This is highly recommended if you are going to upgrade to the latest version of rails. To upgrade RubyGems, issue sudo gem install rubygems-update.
Gotcha: I was unable to install RubyGems on SUSE 10.1 using the method described above. It worked fine on SUSE 10.2. On 10.1, when I issued ruby setup.rb command, it gave me the following error: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': No such file to load -- zlib Based on experience shared by others on Google, I copied the zlib module from another location to where Ruby was looking for it but got the same error. Somewhere, I read you need the development version zlib-devel-1.1.4-8.1 but then I was unsuccessful in installing that one as well (can't recall the specific error). Before I could fix that problem, I moved to SUSE 10.2 where everything went smooth. Rails People say rails can be installed using gem install rails --include-dependencies command (notice two hiphens before include and one hiphen before dependencies). However, when I upgraded to SUSE linux 10.2, I chose to install Ruby and rails out of the box so I didn't have to use this method. I did have to upgrade Rails from version 1.1.6 to 1.2 though. This is because out of the box, SUSE linux 10.2 comes with Ruby v1.8.5 (latest at the time of this writing) and Rails v1.1.6 (not latest at the time of this writing). To upgrade, I used sudo gem update rails --include-dependencies command. That's it! You have the latest and greatest version of Rails.Test it using rails -v command, which should show Rails 1.2.2 or whatever the latest at the time.
| | |
|
|
Installing Ruby on SUSE Linux 10.1 |
|
|
|
|
Written by Chintan Rajyaguru
|
|
Sunday, 04 February 2007 |
|
I took the first step to familiarize myself with Ruby and Rails some time ago. In fact, I blogged about this once. As part of my efforts to gradually move to linux, I decided to continue Ruby and Rails development on my SUSE Linux 10.1 install. Obviously the first step was to install Ruby so today, I am sharing my experience installing Ruby. First of all, check if you already have Ruby installed. Just type ruby -version on command prompt. If Ruby version is displayed, you already have Ruby, if not, install it. Installation is easy, you can build from source:
- Go to http://www/ruby-lang.org and click on Downloads link
- Select the stable release in the Ruby Source Code section - as of this writing Ruby 1.8.5-p12, also available here, is stable
- Place the compressed file in user's home directory. You can go to your home directory using cd $HOME command
- Extract the compressed file e.g. tar xvfz ruby-1.8.5-p12.tar.gz, this will create a directory ruby-1.8.5-p12
- Change to the directory ruby-1.8.5-p12 and issue ./configure command
- At this point, if you don't have gcc package or other C compiler, you will get an error similar to "No appropriate C compiler found in path." If this happens, you have to install gcc package first:
- click on this link
- select Open with Zen installer
- supply root password when asked
- if there are any unresolved dependencies, your default rpm installer should recognize them and get them automatically
- if for some reason, gcc installation doesn't go smooth, fix the it first before proceeding
- Now, ./configure command in /home/<username>/ruby-1.8.5-p12 should work
- Issue make command to build
- Run make install as root to install Ruby
- Run make install-doc as root to install Ruby documentation
- Test installation using ruby -v command. This should display something like ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-linux]
If you don't want to install from source, you can also find a precompiled rpm from places like http://www.rpmfind.net/. Just search for Ruby. For example, a precompiled rpm is available here. I did not install from a precompiled rpm so I don't know about gotchas if any.
Next time, I will talk about a pretty cool irb tool, ruby doc and rails. | | |
|
Last Updated ( Saturday, 17 February 2007 )
|
|
|
|
|
|
BlogSidebar |
| S | M | T | W | T | F | S |
| | 1 | 2 | 3 | 4 | 5 |
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | |
categoriesLatest in BlogASIC ESL |
|
|