I have a Rails application in OpenShift Online that I am trying to configure using RAILS_ENV = development , and not the default production . The idea that will come later, I will add test, intermediate and production domains.
My problem is that since env is installed in development , the OpenShift process, which starts when I click git, says that it skips installing the package:
remote: NOTE: Skipping 'bundle install' because running in development mode.
I got it to install the package by setting RAILS_ENV for production temporarily .
Is there a way to force a package to be installed in an OpenShift Online environment while working in development mode ?
UPDATE:
I tried to force the installation of the package through .openshift / action_hooks / pre_build. Getting Gemfile syntax error during pre_build hook. Gemfile works locally and on OpenShift when using RAILS_ENV = production.
Gemfile
source 'https://rubygems.org' gem 'rails', '4.1.4'
.openshift / action_hooks / pre_build
#!/bin/bash # This is a simple script and will be executed on your CI system if # available. Otherwise it will execute while your application is stopped # before the build step. This script gets executed directly, so it # could be python, php, ruby, etc. if [[ "$RUBY_VERSION" == "1.8" ]]; then echo "ERROR: This quickstart is not compatible with Ruby 1.8" echo "ERROR: Please use ruby-1.9 or ruby-2.0 application type." exit 1 fi if [[ "$RAILS_ENV" == "development" ]] then echo "Forcing bundle install for environment: $RAILS_ENV" pushd $OPENSHIFT_HOMEDIR/app-root/repo > /dev/null bundle install --path ./vendor/bundle popd > /dev/null fi
Exit "git push" to the OpenShift Online app
remote: Stopping MySQL 5.5 cartridge remote: Ruby cartridge in development mode, skipping stop... remote: Force clean build enabled - cleaning dependencies remote: Building git ref 'master', commit 5c3182d remote: Forcing bundle install for environment: development remote: Gemfile syntax error: remote: /var/lib/openshift/540306395973ca6dc30006bc/app-root/runtime/repo/Gemfile:56: remote: syntax error, unexpected ':', expecting $end remote: gem 'sdoc', '~> 0.4.0', group: :doc remote: ^ remote: Building Ruby cartridge remote: NOTE: Skipping 'bundle install' because running in development mode. remote: Preparing build for deployment remote: Deployment id is a65ea3ad remote: Activating deployment remote: Starting MySQL 5.5 cartridge remote: NOTE: The 'rake assets:precompile' is disabled when Ruby is in development mode. remote: bundle exec rake db:migrate RAILS_ENV=development remote: /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-0.9.6 in any of the sources (Bundler::GemNotFound) remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!' remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize' remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs' remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for' remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs' remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs' remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup' remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup' remote: from /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>' remote: from /opt/rh/ruby200/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in `require' remote: from /opt/rh/ruby200/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in `require' remote:
source share