我安装了Ruby,更新了gem,安装了Rails,并添加了mysql
gem。但是,当我尝试使用rails new new_project
创建新项目时,我会收到以下错误。此外,当我运行rails -v
时,我得到相同的错误。我确定这个问题与Rails有关,但是有人知道问题是什么以及如何解决它?
我把所有东西都擦干净并重新安装了三次而没有运气。我安装了thread_safe
。
C:\dev32>rails -v
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'thread_safe' (~> 0.1) - did find: [thread_safe-0.1.2-java] (Gem::LoadError)
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1265: in `block in activate_dependencies'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1254: in `each'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1254: in `activate_dependencies'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1236: in `activate'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1268: in `block in activate_dependencies'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1254: in `each'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1254: in `activate_dependencies'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1236: in `activate'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb :48:in `gem'
from C:/Ruby200/bin/rails:22:in `<main>'
C:\dev32>rails new test_project
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'thread_safe' (~> 0.1) - did find: [thread_safe-0.1.2-java] (Gem::LoadError)
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1265: in `block in activate_dependencies'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1254: in `each'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1254: in `activate_dependencies'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1236: in `activate'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1268: in `block in activate_dependencies'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1254: in `each'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1254: in `activate_dependencies'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1236: in `activate'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb :48:in `gem'
from C:/Ruby200/bin/rails:22:in `<main>'
C:\dev32>
安装了以下宝石
*** LOCAL GEMS ***
actionmailer (4.0.0, 3.2.13)
actionpack (4.0.0, 3.2.13)
activemodel (4.0.0, 3.2.13)
activerecord (4.0.0, 3.2.13)
activerecord-deprecated_finders (1.0.3)
activerecord-sqlserver-adapter (3.2.12, 3.2.10)
activeresource (4.0.0, 3.2.13)
activesupport (4.0.0, 3.2.13)
arel (4.0.0, 3.0.2)
atomic (1.1.13 java)
bigdecimal (1.2.1, 1.1.0)
builder (3.1.4, 3.0.4)
bundler (1.3.5, 1.3.4)
coffee-rails (4.0.0, 3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.3, 1.6.1)
erubis (2.7.0)
execjs (2.0.1, 1.4.0)
hike (1.2.3, 1.2.1)
i18n (0.6.5, 0.6.1)
io-console (0.4.2, 0.3)
journey (1.0.4)
jquery-rails (3.0.4, 2.2.1)
json (1.8.0 java, 1.5.5)
mail (2.5.4, 2.5.3)
mime-types (1.25, 1.21)
minitest (4.7.5, 2.5.1)
multi_json (1.8.0, 1.7.1)
pg (0.16.0 x64-mingw32, 0.14.1 x86-mingw32)
polyglot (0.3.3)
rack (1.5.2, 1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (4.0.0, 3.2.13)
rails-observers (0.1.2)
railties (4.0.0, 3.2.13)
rake (10.1.0, 10.0.3, 0.9.2.2)
rb-readline (0.5.0, 0.4.2)
rdoc (4.0.1, 3.9.5)
rubygems-update (2.1.0)
rubyzip (1.0.0, 0.9.9)
sass (3.2.10, 3.2.7)
sass-rails (4.0.0, 3.2.6)
sprockets (2.10.0, 2.2.2)
sprockets-rails (2.0.0)
sqlite3 (1.3.8 x86-mingw32, 1.3.7 x86-mingw32)
sqlite3-ruby (1.3.3)
thor (0.18.1, 0.17.0)
thread_safe (0.1.2 java)
tilt (1.4.1, 1.3.6)
tiny_tds (0.6.1 x86-mingw32, 0.5.1 x86-mingw32)
treetop (1.4.15, 1.4.12)
tzinfo (1.0.1, 0.3.37)
答案 0 :(得分:0)
错误消息是说你没有thread_safe版本〜&gt; 0.1,并且它确实找到了thread_safe版本0.1.2-java,但它找到的版本并不令人满意。
可能由于某种原因已经安装了java版本,并且它阻止了安装非Java版本。我不知道。
但是,请尝试安装特定版本的thread_safe:
gem install --version 0.1.2 thread_safe
答案 1 :(得分:0)
尝试安装2.0.8版本的RubyGems:
gem uninstall rubygems-update
gem install rubygems-update --version 2.0.8
update_rubygems