Gem 1.5 with Rails 2.3 »
Created at: 19.03.2011 11:48, source: Ruby Rockers, tagged: Solutions gem rails ruby Solutions
You may fall down into the situation where you don’t have RVM and your system gem is upgraded for using latest things.
And your old application is still running on older version of rails.
This is just a workaround of using Gem > 1.3.7 in Rails 2.3 Applications.
I have tested this solution with Rails 2.3.5 and different version of gems.
After upgrading gems to 1.6.2 i have got an error
/activesupport-2.3.5/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
To fix this error need to update boot.rb file. Place this at the top of boot.rb
require 'thread'
After adding this you should be getting this error
/gem_dependency.rb:119:in `requirement': undefined local variable or method `version_requirements'
To fix this error you need update your environment.rb file.
Add this code above your Rails::Initializer.run block.
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.3.7')
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end
Now your application should start running properly. Have fun
Now you can downgrade or upgrade your system gem version. Your application will still run.
Above workaround works for me very well. Any other ideas?
more »
Bundler Usage — Installing Gems »
Created at: 18.03.2011 17:52, source: Ruby Rockers, tagged: Uncategorized bundler rails ruby Ruby on Rails
Every time you change your Gemfile then you might adding/removing any dependancies in your application.
Just bundle install will install gems for you.
The output may look like
$ bundle install Fetching git://github.com/rails/rails.git Fetching source index for http://rubygems.org/ Using rake (0.8.7) Installing abstract (1.0.0) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
You can specify groups for special environments
$ bundle install --without development test
$ bundle install --without test
You can specify installation directory for your gems.
This will install all the gems into tmp/bundle folder
$ bundle install --path tmp/bundle
You can check your applications bundler config.
$ bundle config Settings are listed in order of priority. The top value will be used. disable_shared_gems Set for your local app (/Users/arunagw/errorapp/.bundle/config): "1" path Set for your local app (/Users/arunagw/errorapp/.bundle/config): "tmp/bundle"
For more details about bundler you can checkout http://gembundler.com/
And also http://railscasts.com/episodes/201-bundler
more »
Bundler Usage — Manage Gemfile »
Created at: 17.03.2011 08:34, source: Ruby Rockers, tagged: Technology bundler gemfile rails
In the previous post we posted about basic Bundler usage. Here i am posting about some advance way of managing Gemfile.
Bundler requires a Gemfile. If you are creating a Rails application which is above to version 3, the Gemfile automatic gets created.
Gemfile contains all your dependent gems.
gem "rails", "~> 3.0.5" gem "mysql2"
The above Gemfile explains that we need Rails 3.0.5 and Mysql2 gems for our application.
Gemfile can be manage in different ways.
We can group things together which is only used in specific environment.
group :test do gem "faker end group :development, :test do gem 'ruby-debug' end
We can specify the gem version as a second argument in gem. If there is no version then it will fetch the latest one.
Some time gem name is different and the library needs to be loaded may be different. Then we need to specify specifically the lib name.
gem 'sqlite3-ruby', :require => 'sqlite3'
Loading gem from a git repository directly
If our library or gem is hosted somewhere else then we can add more source at the top of Gemfile. But if we want to fetch Gem from a git repository then we need to something like below. But that library must contain a .gemspec file to consider as a Gem.
gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git'
We can also specify a branch/tag/ref of git repository.
gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git',
:branch => 'stable-2'
gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git',
:tag => 'tag-2'
gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git',
:ref => '23456'
We can load gems from our local path also.
gem 'nokogiri', :path => '~/code/nokogiri'
more »
Install Ruby on Rails on Ubuntu Maverick Meerkat 10.10 »
Created at: 25.12.2010 20:37, source: Hackido, tagged: ruby rails ubuntu
more »
Getting Setup for Ruby on Rails Development »
Created at: 01.12.2010 21:30, source: Engine Yard Blog, tagged: Technology tips development linux mac rails ruby setup tutorial windows
The Resources for Getting Started With Ruby on Rails seemed to be useful for a lot of people. However, it was a post geared for people who had already setup their computers for development work. So I created a tutorial for those of you who haven't yet set up your computers for Ruby on Rails development. Just go to the Engine Yard Documentation Area, in the tutorials section. There you'll find instructions for setting up your computer, basic git commands, and a step-by-step tutorial on creating an application with Rails 3 and Bundler. Each section is designed to be useful by itself, so if you just want to learn more about Bundler or Rails 3 you can. If you have any feedback on how to improve the tutorials let me know in the comments section. Also, if you want to take a hands-on training course on how to develop a Rails application, you might want to attend the Zero to Rails 3 class which is happening (online) December 20-23.
more »



