पर रूबी "बंडल इंस्टॉल" त्रुटि रूबी में काफी नया है और दूरस्थ उपकरणों के माध्यम से ऐप को तैनात करने की शर्तें है। मैंने अपनी ऐप को मुफ्त openshift खाते पर तैनात करने की कोशिश की है। और मैं रन आवेदन नहीं जानता।ओपनशेफ्ट
जब मैं अनुप्रयोग चलाने मैं इस त्रुटि मिलती है:
You have already activated rack 1.5.2, but your Gemfile requires rack 1.6.0.
Using bundle exec may solve this. (Gem::LoadError)
तो मैं bundle exec
चलाने का प्रयास, लेकिन मैं एक और त्रुटि मिली:
Gemfile syntax error:
/var/lib/openshift/xxxxxxxxxxxxxxxxxxxxxxxxxx/app-root/runtime/repo/Gemfile:24:
syntax error, unexpected ':', expecting $end
gem 'sdoc', '~> 0.4.0', group: :doc
मैं क्योंकि मैं रूबी 2.1 इस्तेमाल किया यह हो सकता है लगता है। स्थानीय और ओपन शिफ्ट पर 5 डिफ़ॉल्ट रूप से रूबी 2.0 चलाता है।
मैंने इस विषय को How can I force a bundle install on OpenShift Online when my RAILS_ENV is set to development? पर जोर दिया था, लेकिन मुझे नहीं पता कि मैं इसे सही कर रहा हूं या नहीं। मुझे यह भी नहीं पता कि यह pre_build
फ़ाइल कहां रखी जाए। मैंने इसे /var/lib/openshift/xxxxxxxxxxxxxxxxxxxxxxxxxx/app-root/runtime/repo/.openshift/action_hooks/
के तहत डालने की कोशिश की। लेकिन मुझे यकीन नहीं है कि runtime
सही रेपो है।
संपादित करें 1:
यह यह मेरी Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# 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/sstephenson/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.
group: :doc do
gem 'sdoc', '~> 0.4.0'
end
# 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'
# 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, :jruby]
समाधान:
रूप @Rajarshi दास ने कहा कि मैं
gem 'sdoc', '~> 0.4.0', group: :doc
बदलना पड़ा मैं nto
group: :doc do
gem 'sdoc', '~> 0.4.0'
end
मुझे बिल्कुल पता नहीं क्यों। शायद कुछ वाक्यविन्यास मुद्दे जैसे कि मैं स्थानीय पर रूबी 2.1.5 का उपयोग कर रहा था, और उत्पादन पर 2.0.0 का उपयोग करना पड़ा। और उसके बाद मुझे gem install rails
चलाया गया, भले ही मैंने रेलों की त्वरित शुरुआत की। अंत में मुझे मैन्युअल रूप से Gemfile gem 'nokogiri'
में जोड़ना पड़ा। अंत में मैं bundle install
चला सकता था और एप्लिकेशन काम करना शुरू कर दिया था।
मैं इसे अपने Git भंडार होना जरूरी लगता है कि देख सकते हैं। फॉर्म जो मैं bulid के लिए फ़ाइलें डाउनलोड करता हूं, openshift सर्वर पर भंडार नहीं। रेलवे के लिए इसे कैसे सेट करें 2.1 तैनाती? –
मुझे एक ही समस्या है। 'बंडल exec' –
का उपयोग करके एप्लिकेशन को चलाने के लिए आपको किन परिवर्तनों की आवश्यकता है, मैं रूबी में काफी नया हूं। तो मेरे ज्यादातर कार्यों अंधेरे में शूटिंग कर रहे थे। मुझे लगता है कि आपको बंडल इंस्टॉल करने का प्रयास करना चाहिए। मुझे लगता है कि बंडल इंस्टॉल जेमफाइल और बंडल निष्पादन का उपयोग करता है। फ़ाइल खोलें। –