无法找到gem' rails(= 4.2.5)x86-mingw32'当运行rails服务器时

时间:2015-11-18 10:00:16

标签: ruby-on-rails ruby ruby-on-rails-3 rubygems

我正在尝试学习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'

enter image description here

有人有类似的问题吗?你能帮我解决一下吗?

更新

我的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]

尝试运行&#39;捆绑安装&#39;

时出错

enter image description here enter image description here

3 个答案:

答案 0 :(得分:0)

尝试安装以下软件包以成功完成软件包安装

sudo apt-get install build-essential
sudo apt-get install libgmp3-dev

这些软件包适用于Linux环境。找到其他环境的替代方案。如果您有任何错误,请告诉我。

答案 1 :(得分:0)

打开文件Gemfile.lock,找到并删除“x64-mingw32”然后运行命令: -

$ bundle install

答案 2 :(得分:0)

最新答案,但这只是我刚才的事情。 对我有用的是弄清楚我不小心安装了旧版本的Ruby。

在上一个屏幕截图中,您收到一行:

Make sure that `gem install json -v '1.8.3'` succeeds before bundling

此命令可能是由于Ruby版本较旧而失败,请在此处获取最新版本(假设您是Windows用户)https://rubyinstaller.org/downloads/

PS

确保删除所有以前的Ruby / Rails安装。 您需要的是一个“ With DEVKIT”安装程序,最好是他们推荐的安装程序(以“ =>”开头)。

相关问题