views:

73

answers:

2

when I run any rails command like rails s I get the following error:

Could not find diff-lcs-1.1.2 in any of the sources Try running bundle install.

However, I already installed diff-lcs.

bundle show diff-lcs /opt/local/lib/ruby1.9/gems/1.9.1/gems/diff-lcs-1.1.2

I also see diff-lcs when I do a gem list command

My GEM_HOME is /opt/local/lib/ruby1.9/gems/1.9.1

For reference, here's the contents of my Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.0'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

group :development do
  gem 'rspec-rails', '2.0.0'
end

group :test do
  gem 'rspec', '2.0.0'
  gem 'webrat', '0.7.1'
end

And the output of which rails is /usr/bin/rails

+2  A: 

If you are using Rails 3, edit 'Gemfile' in the root of your rails app such that it contains

gem 'diff-lcs'

Then run 'bundle install' from the root of your rails app.

suihock
I am using rails 3. I tried that and getting same exact error when I run any rails command.
Ben
A: 

Type "gem env" on your terminal. Check the executable path. Verify that it's set correctly.

> gem environmentRubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [x86_64-darwin10] - INSTALLATION DIRECTORY: /opt/local/lib/ruby1.9/gems/1.9.1 - RUBY EXECUTABLE: /opt/local/bin/ruby - EXECUTABLE DIRECTORY: /opt/local/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-10 - GEM PATHS: - /opt/local/lib/ruby1.9/gems/1.9.1 - /Users/ben/.gem/ruby/1.9.1 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000
Ben
looks like it's set correctly
Ben
is /opt/local/bin set in your $PATH? Try running rails commmands by going into that directory e.g. cd /opt/local/bin --> ./rails
echo $PATH/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Ben