2017-07-26 96 views
0

我有一個rails應用程序,我在安裝寶石,它工作正常。 現在,我不知道我做了什麼,當我在Gemfile中添加一個gem並運行bundle安裝時,該應用程序崩潰時找不到Gem錯誤(例如:「我們很抱歉,但出錯了。 。無法在任何來源(Bundler :: GemNotFound)中找到gmaps4rails-2.1.2 ...「)。Rails寶石路徑錯誤

我試着命令: 其中寶石gmaps4rails 輸出:在/ usr/bin中/寶石

客運錯誤顯示: 系統信息

Ruby interpreter command 
/home/webmaster/.rbenv/versions/2.3.3/bin/ruby 

User and groups 
uid=1001(webmaster) gid=33(www-data) groups=33(www-data),27(sudo),110(lxd) 

Environment variables 

APACHE_RUN_DIR = /var/run/apache2 
APACHE_PID_FILE = /var/run/apache2/apache2.pid 
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
APACHE_LOCK_DIR = /var/lock/apache2 
LANG = C 
APACHE_RUN_USER = www-data 
APACHE_RUN_GROUP = www-data 
APACHE_LOG_DIR = /var/log/apache2 
PWD = /var/www/maus_view 
PASSENGER_USE_FEEDBACK_FD = true 
SERVER_SOFTWARE = Apache/2.4.18 (Ubuntu) Phusion_Passenger/5.1.5 
PASSENGER_DEBUG_DIR = /tmp/passenger.spawn-debug.XXXXIfqFGX 
USER = webmaster 
LOGNAME = webmaster 
SHELL = 
HOME = /home/webmaster 
IN_PASSENGER = 1 
PYTHONUNBUFFERED = 1 
NODE_PATH = /usr/share/passenger/node 
RAILS_ENV = development 
RACK_ENV = development 
WSGI_ENV = development 
NODE_ENV = development 
PASSENGER_APP_ENV = development 
BUNDLER_ORIG_PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
GEM_PATH = /home/webmaster/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0:/home/webmaster/.gem/ruby/2.3.0 
GEM_HOME = /home/webmaster/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0 

我已經讀了很多計算器的帖子,但我無法調試並找到解決此問題的方法。

有人可以幫我嗎?

謝謝

---編輯---

這是我的Gemfile:

source 'https://rubygems.org' 

git_source(:github) do |repo_name| 
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 
    "https://github.com/#{repo_name}.git" 
end 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.0.2' 
# Use mysql as the database for Active Record 
gem 'mysql2', '>= 0.3.18', '< 0.5' 
# Use Puma as the app server 
gem 'puma', '~> 3.0' 
# 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.2' 
# 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 navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# 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', platform: :mri 
end 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console', '>= 3.3.0' 
    gem 'listen', '~> 3.0.5' 
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    gem 'spring' 
    gem 'spring-watcher-listen', '~> 2.0.0' 
end 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

gem 'devise' 
#gem 'gmaps4rails' 
+0

你可以發佈你的Gemfile內容,它可能有幫助嗎?我試過 「gem install gmaps4rails」,但是我有一個錯誤: 「錯誤:執行gem時...(Errno: – Sanjiv

+0

)你試過運行'gem install gmaps4rails' –

回答

2

你需要通過命令行安裝它們,而不是隻是一些寶石「捆綁安裝「他們。 因此,嘗試運行:

gem install gmaps4rails

,並轉到你項目目錄和打bundle install

希望它能幫助!

+0

從我的應用程序根目錄中, :EACCES) 權限被拒絕@ rb_sysopen - /var/lib/gems/2.3.8/gems/gmaps4rails-2.1.2/.gitignore「 – Massimiliano

+0

您使用的是Ubuntu操作系統嗎?如果嘗試運行sudo命令並讓我知道 – Aashish

+0

是@Aashish,我在Ubuntu服務器16.04上。 sudo的創業板安裝gmaps4rails 工作 然後我打了包安裝 但: 束秀gmaps4rails 輸出: 「找不到gmaps4rails」 其中寶石gmaps4rails輸出:在/ usr/bin中/寶石 在資產管道我把: // =要求下劃線 // =需要gmaps /谷歌 寶石我認爲不工作,因爲我得到鏈輪:: FileNotFound錯誤:(找不到文件'gmaps /谷歌'的類型'應用程序/ JavaScript的') – Massimiliano