2017-10-14 267 views
0

我得到不同的錯誤 的Web應用程序無法啓動Web應用程序無法啓動redmine3.4

Web application could not be started 
There was an error while trying to write to Gemfile.lock. It is likely that 

you need to allow write permissions for the file at path: 
/usr/share/redmine/Gemfile.lock (Bundler::InstallError) 
/usr/lib/ruby/vendor_ruby/bundler/definition.rb:235:in rescue in lock' /usr/lib/ruby/vendor_ruby/bundler/definition.rb:220:inlock’ 
/usr/lib/ruby/vendor_ruby/bundler/environment.rb:34:in lock' /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:43:insetup’ 
/usr/lib/ruby/vendor_ruby/bundler.rb:120:in setup' /usr/lib/ruby/vendor_ruby/bundler/setup.rb:17:in<top (required)>’ 
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require' /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’ 
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:245:in block in run_load_path_setup_code' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:348:inrunning_bundler’ 
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:243:in run_load_path_setup_code' /usr/share/passenger/helper-scripts/rack-preloader.rb:100:inpreload_app’ 
/usr/share/passenger/helper-scripts/rack-preloader.rb:158:in <module:App>' /usr/share/passenger/helper-scripts/rack-preloader.rb:29:inmodule:PhusionPassenger’ 
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `’ 
+0

您可能使用過apt來安裝RoR。不要這樣做:http://railsapps.github.io/installrubyonrails-ubuntu.html – jdv

回答

-1

您的問題的解決方案可以在下面的鏈接

Gemfile.lock write error, permissions?

找到

在終端做

$whoami 

從上面的命令的輸出必須用來給寫權限的文件夾,files.In終端做

cd /usr/shared 

    sudo chown -R $(whoami):$(whoami) redmine/ 

如果沒有用戶名問題,請嘗試以下

sudo chmod -R 777 redmine/ 
+0

遞歸設置所有文件爲「777」是一個非常糟糕的建議。這會消除服務器上的*任何*安全保證,並可能導致部署的Web應用程序中的遠程代碼執行漏洞。 –

+0

@HolgerJust,謝謝你指出遞歸使用777的危險。 – suresh

+0

先生,我改變了權限,但重新啓動Apache後我得到這個錯誤 Web應用程序無法啓動 未定義的方法'require_sudo_mode'EmailAddressesController:Class(NoMethodError) /usr/share/redmine/app/controllers/email_addresses_controller。 rb:21:在''中 /usr/share/redmine/app/controllers/email_addresses_controller.rb:18:in' sriram

0

之前開始Redmine,你需要安裝必要的寶石。爲此,導航到Gemfile所在的目錄並運行bundle install。在你的情況,這就是:

cd /usr/share/redmine 
bundle install 

一定要運行這是與目錄寫權限的用戶。如果這只是根目錄,則可以在該目錄中運行sudo bundle install

每次更改Gemfile時都必須重複此操作,通常在每次部署新代碼之後。