Colin Law wrote:
> 2010/1/12 Boris Bob <[email protected]>:
>> Hi
>> Strange thing happens when i run rails project it makes project but when
>> i run script/generate or script/server it writes
>>
>> Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, update
>> your RAILS_GEM_VERSION setting in config/environment.rb for the Rails
>> version you do have installed, or comment out RAILS_GEM_VERSION to use
>> the latest version installed.
>>
>> so rails -v gives Rails 2.3.5
>
> I can't help much not being a mac man, but I believe that this can
> happen if rails is installed twice in different places. Google for
> 'missing the rails gem' might help.
>
> Colin
Exactly, i have 1.2.3 1.2.6 installed to
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
and 2.3.5 version here
/Library/Ruby/Gems/1.8
don't know what default is - i guess it's /Library/Ruby/Gems/1.8
i removed files from that directory
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
but it didn't help.
So in file "server" (script/server) we have 2 lines of code
#!/usr/bin/env ruby
require File.expand_path('../../config/boot', __FILE__)
require 'commands/server'
first line load boot file and in booot file we have that line that loads
gems
class GemBoot < Boot
def load_initializer
self.class.load_rubygems
load_rails_gem
require 'initializer'
end
def load_rails_gem
if version = self.class.gem_version
gem 'rails', version
else
gem 'rails'
end
rescue Gem::LoadError => load_error
$stderr.puts %(Missing the Rails #{version} gem. Please `gem
install -v=#{version} rails`, update your RAILS_GEM_$
exit 1
end
i am not an expert in ruby so far but i guess this function returns
false
"load_rails_gem" and this expression returns false "gem 'rails'" so it's
a gem method but what it's doing ?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.