Wednesday, 15 July 2015

Ruby on Rails Passenger on Apache gemfile syntax Error ID 506682d5 -



Ruby on Rails Passenger on Apache gemfile syntax Error ID 506682d5 -

running rails 4 on apache2 using phusion passenger , ruby 2.1 installed via rvm. when access rails app in browser, error:

gemfile syntax error compile error on line 24: syntax error, unexpected ':', expecting $end gem 'sdoc', '~> 0.4.0', group: :doc ^ (bundler::gemfileerror) /home/romistrub/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.3/lib/bundler/dsl.rb:35:in `eval_gemfile' /home/romistrub/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.3/lib/bundler/dsl.rb:10:in `evaluate' /home/romistrub/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.3/lib/bundler/definition.rb:25:in `build' /home/romistrub/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.3/lib/bundler.rb:154:in `definition' /home/romistrub/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.3/lib/bundler.rb:117:in `setup' /home/romistrub/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.3/lib/bundler/setup.rb:17 /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:59:in `gem_original_require' /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:59:in `require' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:263:in `run_load_path_setup_code' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:366:in `running_bundler' /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:261:in `run_load_path_setup_code' /usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:158 error id 506682d5

rails app gemfile:

source 'https://rubygems.org' # bundle border rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.1.6' # utilize sqlite3 database active record gem 'sqlite3' # utilize scss stylesheets gem 'sass-rails', '~> 4.0.3' # utilize uglifier compressor javascript assets gem 'uglifier', '>= 1.3.0' # utilize coffeescript .js.coffee assets , views gem 'coffee-rails', '~> 4.0.0' # see https://github.com/sstephenson/execjs#readme more supported runtimes # gem 'therubyracer', platforms: :ruby # utilize jquery javascript library gem 'jquery-rails' # turbolinks makes next links in web application faster. read more: https://github.com/rails/turbolinks gem 'turbolinks' # build json apis ease. read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates api under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc # spring speeds development keeping application running in background. read more: https://github.com/rails/spring gem 'spring', group: :development # utilize activemodel has_secure_password # gem 'bcrypt', '~> 3.1.7' # utilize unicorn app server # gem 'unicorn' # utilize capistrano deployment # gem 'capistrano-rails', group: :development # utilize debugger # gem 'debugger', group: [:development, :test]

the command

cat $(which bundle)

gives

#!/usr/bin/env ruby_executable_hooks # # file generated rubygems. # # application 'bundler' installed part of gem, , # file here facilitate running it. # require 'rubygems' version = ">= 0" if argv.first str = argv.first str = str.dup.force_encoding("binary") if str.respond_to? :force_encoding if str =~ /\a_(.*)_\z/ , gem::version.correct?($1) version = $1 argv.shift end end gem 'bundler', version load gem.bin_path('bundler', 'bundle', version)

command

rake

gives

about application's environment ruby version 2.1.3-p242 (x86_64-linux) rubygems version 2.2.2 rack version 1.5 rails version 4.1.6 javascript runtime node.js (v8) active record version 4.1.6 action pack version 4.1.6 action view version 4.1.6 action mailer version 4.1.6 active back upwards version 4.1.6 middleware rack::sendfile, actiondispatch::static, rack::lock, # <activesupport::cache::strategy::localcache::middleware:0x00000004ec86d8>, rack::runtime, rack::methodoverride, actiondispatch::requestid, rails::rack::logger, actiondispatch::showexceptions, actiondispatch::debugexceptions, actiondispatch::remoteip, actiondispatch::reloader, actiondispatch::callbacks, activerecord::migration::checkpending, activerecord::connectionadapters::connectionmanagement, activerecord::querycache, actiondispatch::cookies, actiondispatch::session::cookiestore, actiondispatch::flash, actiondispatch::paramsparser, rack::head, rack::conditionalget, rack::etag application root /var/www/board/demo environment development database adapter sqlite3 database schema version 0

i have no thought start one.

any help appreciated. in advance.

turns out issue passenger on rvm, wherein passenger using wrong ruby binary.

after making sure using right ruby in rvm via

ruby utilize 2.1

then checking using proper passengerruby directive in apache using

passenger-config --ruby-command

then changing apache configuration result of above command:

passengerruby /home/<user>/.rvm/gems/ruby-2.1.3/wrappers/ruby

everything worked.

well, almost. encountered error: missing secret_key_base env. prepare that, added /etc/apache2/envvars next line:

export secret_key_base=<thisisthesupersecretsecretkeypleasedontcopy>

and restarted apache. problem next error, hope has basic fix:

the page looking doesn't exist.

apache ruby-on-rails-4 rvm passenger ruby-2.1

No comments:

Post a Comment