I want to install rails (so I can run rake gems:install). when i type
sudo gem install rails
it's installing it but I can't see it in gems list. the only gem I
see is rake.
is there a way to access all my existing gems that works with 1.8?
I want to install rails (so I can run rake gems:install). when i type
sudo gem install rails
it's installing it but I can't see it in gems list. the only gem I
see is rake.
is there a way to access all my existing gems that works with 1.8?
Nope the gems are kept in separate subdirectories. You could rename
those directories, but I'd recommend keeping them separate.
For now, I'd recommend doing "gem install" for all your gems in both
versions of ruby.
GL!
-r
For now, I'd recommend doing "gem install" for all your gems in both
versions of ruby.
GL!
-r
It's installing it but gem list shown nothing but rake!
sudo gem install rails
Successfully installed rails-2.3.3
1 gem installed
Installing ri documentation for rails-2.3.3...
Updating ri class cache with 5437 classes...
Installing RDoc documentation for rails-2.3.3...
~> gem list
Create a .gemrc file in your home directory (~) to declare GEM_PATH
and GEM_HOME, this is in yaml format.
Replace the gempath with whatever the path is on your machine if its
different.
# add what is below
gemhome: /home/yourusername/gems
gempath:
- /home/yourusername/gems
- /usr/lib/ruby/gems/1.8
Verify the environment has changed with:
$ gem environment
Hope this helps
···
On Aug 15, 10:54 am, oren <orengo...@gmail.com> wrote:
> For now, I'd recommend doing "gem install" for all your gems in both
> versions of ruby.
> GL!
> -r
It's installing it but gem list shown nothing but rake!
sudo gem install rails
Successfully installed rails-2.3.3
1 gem installed
Installing ri documentation for rails-2.3.3...
Updating ri class cache with 5437 classes...
Installing RDoc documentation for rails-2.3.3...
~> gem list
I started following the steps:
sudo mv /usr/bin/ruby /usr/bin/ruby18
sudo mv /usr/bin/irb /usr/bin/irb18
sudo mv /usr/bin/gem /usr/bin/gem18
but i am not sure what to do in the next step:
"Then create your ruby/irb/gem symlinks to point to whichever Ruby
install you're using:
ln -fs /usr/local/bin/ruby19 /usr/local/bin/ruby"
now i still have issue when running rake gems:install
rake aborted!
Could not find RubyGem test-unit (= 2.0.2)
/home/oren/silica/Rakefile:10:in `require'
now i still have issue when running rake gems:install
rake aborted!
Could not find RubyGem test-unit (= 2.0.2)
/home/oren/silica/Rakefile:10:in `require'
and i can switch ruby versions with select_ruby script that updates a
symbolic link that points to the active version.
Updating a single symbolic link wasn't enough here - I wanted to update gem binaries as well. Here's what I use (and I am sure you can deduce further details from the script)...
kaspar
···
--------------
#!/usr/local/share/ruby19/bin/ruby
def base_path
'/usr/local/share/'
end
def bin_dir(version)
File.join(base_path, version, 'bin')
end
def lib_dir(version)
File.join(base_path, version, 'lib')
end
def replace_symlink(source, dest)
if !File.exists?(dest) || File.symlink?(dest)
print "[#{File.basename(dest)}] "
`sudo ln -nsf #{source} #{dest}`
end
end
# Iterates over binaries in version.
#
def all_binary_links(version) # yield: binary_path, symlink_path
Dir[File.join(bin_dir(version), '*')].each do |binary_path|
binary_name = File.basename(binary_path)
yield binary_path, File.join('/usr/bin', binary_name)
end
end
def switch_to(ruby_version, old_version)
# Remove current (old) symlinks
puts "Removing old links..."
all_binary_links(old_version) do |bin_path, link_path|
print '.'
`sudo rm #{link_path} 2>/dev/null`
end
puts
puts "Symlinking new version..."
all_binary_links(ruby_version) do |bin_path, link_path|
replace_symlink(bin_path, link_path)
end
puts
# Symlink /lib
replace_symlink(
lib_dir(ruby_version),
'/usr/lib/ruby')
puts
end
case ARGV.first
when /19/
switch_to :ruby19, :ruby18
when /18/
switch_to :ruby18, :ruby19
else
puts "Run with either '19' or '18' to switch to the given ruby version..."
end
and i can switch ruby versions with select_ruby script that updates a
symbolic link that points to the active version.
If you value a working ubuntu system in which you can install such
packages as vim-gnome and other useful programs that use ruby, by using
apt-get, then you'll stay *far* away from these instructions, and you'll
content yourself to useing suffixes on the names of the ruby binaries to
specify which version you want at the moment you want it.
This is your warning that following these directions will break your
Ubuntu box in certain respects.
--Ken
···
On Mon, 17 Aug 2009 04:00:10 +0900, oren wrote:
--
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/