0

在我的 rails 应用程序中查看主页时遇到问题。当我运行它时,我收到以下错误:

在 gemfile 中列出的任何 gem 源中找不到 gem 'rails =3.1.0 x86-ming32

我的gem文件的内容如下:

source 'http://rubygems.org'

gem 'rails', '3.1.0'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails', "  ~> 3.1.0"
  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'

end

gem 'jquery-rails'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
  # Pretty printed test output
  gem 'turn', :require => false
end
4

2 回答 2

0

When I run it

May I ask how you are running it?

Instead of assuming, you are running bundle exec rails g model Somthing. Or whatever command you were running.

also what does bundle list say? can you see all the rails gems from the list that this command gives you?

于 2012-05-10T12:37:56.660 回答
0
    rails (= 3.1.0) ruby depends on
  railties (3.1.0)

因此,除非您拥有提供所需依赖项的源,否则它不会捆绑。

我建议安装 rails 3.2.3 并使用它。

gem install rails   #will install the newest rails

在宝石文件中:

gem 'rails', '3.2.3' 

然后运行

$:.bundle update.
于 2012-05-10T14:03:02.427 回答