2015-11-18 53 views
1

我正在嘗試學習Ruby on Rails。 目前正在嘗試Rails框架。我已經安裝了它。在MyBlog文件夾中創建新的項目,但是當我嘗試運行:運行rails服務器時找不到gem'rails(= 4.2.5)x86-mingw32'

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. 

我已經安裝了捆綁的建議。安裝它也很少出現問題,但我在互聯網上發現了一個靈魂。

軟件包之前安裝我正在另一個錯誤說,它不能找到寶石「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] 

錯誤時嘗試運行 '包安裝':

enter image description here enter image description here

+0

你有一個問題,但建議的解決方案解決了這個問題。大。但你之前還有另一個問題?你還擁有它嗎?我無法跟隨。你真正的問題是什麼?你現在面臨什麼問題? – spickermann

+0

@spickermann當我運行'rails server'命令時,問題不在於創建rails gem。 –

+0

你能發佈你的寶石文件和軟件包安裝錯誤嗎? – SaravanaKumAr

回答

0

嘗試安裝以下軟件包成功捆綁安裝

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

這些軟件包用於Linux環境。找到其他環境的替代方案。讓我知道你是否有任何錯誤。

+0

我試過用gem install build-essentials ...但我想這不適用於Windows的命令,它適合您爲Unix提供的命令。 我收到了: C:\ Users \ n.mosorinski \ Rails \ apps \ MyBlog> gem install build-essential 錯誤:在任何存儲庫中找不到有效的gem'build-essential'(> = 0) 錯誤:可能的替代方案:knife-essentials,build_eval,essentials,spree_e ssentials –

+0

我已經提到在答案本身 – SaravanaKumAr

+0

你可以檢查這一個http://stackoverflow.com/questions/33084811/error-in-installing-json -gem換紅寶石在窗口 – SaravanaKumAr

0

打開文件Gemfile.lock的,找到並刪除「x64的mingw32的」然後運行命令: -

$捆綁安裝