我昨天重新安装了 Ubuntu 12.04,并且第一次在这个环境中使用 Ruby/Rails,并直接从我的 Windows 机器上复制了这个项目。我安装了 rubygems,然后cd
'd 到项目目录并运行bundle install
,它没有任何错误。
当尝试启动服务器时 ( rails s
) ,服务器永远不会启动,我得到一个异常:
/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': 在 [] (Gem::LoadError) 中找不到 railties (>= 0)
来自 /usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:256:in gem' 来自 /usr/local/bin/rails:18
to_spec'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1208:in
我的 Gemfile 如下:
source 'http://rubygems.org'
gem 'rails', '3.2.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'execjs'
gem 'therubyracer'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'devise'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
一切都是生成器留下的大部分内容。谢谢你。