【发布时间】:2016-02-20 00:04:04
【问题描述】:
我正在尝试学习 Ruby on Rails。 目前正在试用 Rails 框架。我已经安装了它。在 MyBlog 文件夹中创建新项目,但是当我尝试运行时:
rails server
我得到一个错误:
Could not find gem 'rails (= 4.2.5) x86-mingw32' in any of the gem sources listed in your Gemfile or available on this machine. Run `bundle install` to install missing gems.
我已按照建议安装了捆绑包。安装它也没有什么问题,但我在互联网上找到了一个灵魂。
在捆绑安装之前,我收到另一个错误,说它找不到 gem 'sqlite3'
有人遇到过类似的问题吗?你能帮我解决一下吗?
更新:
我的 Gemfile 的内容是:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
尝试运行“捆绑安装”时出错:
【问题讨论】:
-
您遇到了问题,但使用建议的解决方案解决了它。伟大的。但是你之前有另一个问题吗?你还拥有它吗?我跟不上。你的实际问题是什么?你现在面临什么问题?
-
@spickermann 当我运行'rails server'命令时,问题是没有创建rails gem。
-
您能发布您的 gem 文件和捆绑安装错误吗?
-
@SaravanaKumAr 当然,我会立即编辑我的帖子。
标签: ruby-on-rails ruby ruby-on-rails-3 rubygems