Strange error occuring at server start , please look at logs
umair-2:game-minion umairejaz$ rails server
/Library/Ruby/Gems/1.8/gems/railties-3.1.0.rc5/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Could not load SystemTimer >= v1.2.0. Falling back to timeout.rb. SystemTimer is STRONGLY recommended for timeouts in Ruby 1.8.7. See http://ph7spot.com/blog/system-timer-1-2-release for details.
=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 1, col 24: ` allow_dynamic_fields: true' (ArgumentError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.20/lib/mongoid/railtie.rb:53
from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `instance_exec'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in `run'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:50:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:134:in `initialize!'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `send'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
from /Users/umairejaz/Projects/game-minion/config/environment.rb:5
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
from /Users/umairejaz/Projects/game-minion/config.ru:3
from /Library/Ruby/Gems/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
from /Library/Ruby/Gems/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
from /Users/umairejaz/Projects/game-minion/config.ru:1:in `new'
from /Users/umairejaz/Projects/game-minion/config.ru:1
Check any of your YAML files under the config folder, specifically one that has the allow_dynamic_fields setting in it. It's likely an error either above, below, or on that particular line. Remove any extraneous whitespace and reformat things (i.e. either use tabs or spaces, not both). Check for any other clutter or extraneous keywords.
Related
I'm just starting Test First Ruby & I'm having trouble running rakes to start solving problems.
I think it's either my version of RSpec or my version of Ruby that's causing the error.
Here's the error,
AT MacBook-Pro:01_temperature AT$ rake
(in /Users/AT/Desktop/learn_ruby)
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- temperature (LoadError)
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/AT/Desktop/learn_ruby/01_temperature/temperature_spec.rb:18:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/configuration.rb:1105:in `load'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/configuration.rb:1105:in `block in load_spec_files'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/configuration.rb:1105:in `each'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/configuration.rb:1105:in `load_spec_files'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/runner.rb:96:in `setup'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/runner.rb:84:in `run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/runner.rb:69:in `run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/lib/rspec/core/runner.rb:37:in `invoke'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.1.2/exe/rspec:4:in `<top (required)>'
from /usr/bin/rspec:23:in `load'
from /usr/bin/rspec:23:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -S rspec /Users/AT/Desktop/learn_ruby/01_temperature/temperature_spec.rb -I/Users/AT/Desktop/learn_ruby/01_temperature -I/Users/AT/Desktop/learn_ruby/01_temperature/solution -f documentation -r ./rspec_config failed
I had a similar problem a few minutes ago but fixed by uninstalling RSpec v-3, and installing v-2.14.
Any help would be appreciated!
Your file temperature_spec is requiring what I presume is the source for the class under test, temperature - but the RSpec loader is not able to resolve the path for this file.
It would be helpful for you to post both the source of your rspec file and your class under test.
Hi all I am working with Phusion Passenger and I go to run my web app and it gives me Ruby 2.0 is not a valid platform. Here is my output below, any ideas?
Thanks!
ruby_20` is not a valid platform. The available options are: [:ruby, :ruby_18, :ruby_19, :mri, :mri_18, :mri_19, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19] (Bundler::DslError)
/usr/lib/ruby/vendor_ruby/bundler/dsl.rb:209:in `block in _normalize_options'
/usr/lib/ruby/vendor_ruby/bundler/dsl.rb:207:in `each'
/usr/lib/ruby/vendor_ruby/bundler/dsl.rb:207:in `_normalize_options'
/usr/lib/ruby/vendor_ruby/bundler/dsl.rb:56:in `gem'
/home/bistro/openproject/Gemfile:82:in `evaluate'
/usr/lib/ruby/vendor_ruby/bundler/dsl.rb:7:in `instance_eval'
/usr/lib/ruby/vendor_ruby/bundler/dsl.rb:7:in `evaluate'
/usr/lib/ruby/vendor_ruby/bundler/definition.rb:17:in `build'
/usr/lib/ruby/vendor_ruby/bundler.rb:136:in `definition'
/usr/lib/ruby/vendor_ruby/bundler.rb:124:in `load'
/usr/lib/ruby/vendor_ruby/bundler.rb:107: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:in `require'
/var/lib/gems/1.9.1/gems/passenger-4.0.29/lib/phusion_passenger/loader_shared_helpers.rb:219:in `block in run_load_path_setup_code'
/var/lib/gems/1.9.1/gems/passenger-4.0.29/lib/phusion_passenger/loader_shared_helpers.rb:333:in `running_bundler'
/var/lib/gems/1.9.1/gems/passenger-4.0.29/lib/phusion_passenger/loader_shared_helpers.rb:217:in `run_load_path_setup_code'
/var/lib/gems/1.9.1/gems/passenger-4.0.29/helper-scripts/rack-preloader.rb:96:in `preload_app'
/var/lib/gems/1.9.1/gems/passenger-4.0.29/helper-scripts/rack-preloader.rb:153:in `<module:App>'
/var/lib/gems/1.9.1/gems/passenger-4.0.29/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/var/lib/gems/1.9.1/gems/passenger-4.0.29/helper-scripts/rack-preloader.rb:28:in `<main>'
I have tried updating Ruby Gems, Updating Bundler, reinstalling Phusion - and I am not sure what else to do. Any thoughts?
Update 2:
I updated the Gem files in the Open project directory and still nothing.
It looks like Bundle updated now I am getting a different error:
Cannot execute "/var/lib/gems/1.9.1/gems/passenger-4.0.29/buildout/agents/SpawnPreparer": No such file or directory (errno=2) Application root /home/bistro/openproject Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV and PASSENGER_ENV) production Ruby interpreter command /usr/bin/ruby1.9.1 User and groups Unknown Environment variables Unknown Ulimits Unknown
When I run rackup from within my app directory, it works fine:
walkraft#li234-166:~/discourse$ rackup config.ru
Flushing redis (development mode)
/home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
/home/walkraft/discourse/vendor/gems/message_bus/lib/message_bus.rb:130: warning: already initialized constant ENCODE_SITE_TOKEN
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:9292, CTRL+C to stop
However, if I try running rackup from outside this directory:
walkraft#li234-166:~$ rackup discourse/config.ru
/home/walkraft/discourse/config/application.rb:7:in `require': cannot load such file -- ./lib/discourse_plugin_registry (LoadError)
from /home/walkraft/discourse/config/application.rb:7:in `<top (required)>'
from /home/walkraft/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/walkraft/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/walkraft/discourse/config/environment.rb:2:in `<top (required)>'
from /home/walkraft/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/walkraft/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/walkraft/discourse/config.ru:2:in `block in <main>'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/builder.rb:51:in `initialize'
from /home/walkraft/discourse/config.ru:in `new'
from /home/walkraft/discourse/config.ru:in `<main>'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/builder.rb:40:in `parse_file'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/server.rb:200:in `app'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/server.rb:304:in `wrapped_app'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/server.rb:254:in `start'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/lib/rack/server.rb:137:in `start'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.4/bin/rackup:4:in `<top (required)>'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/bin/rackup:19:in `load'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/bin/rackup:19:in `<main>'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `eval'
from /home/walkraft/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `<main>'
How can I run rackup when I'm not inside of the root directory?
If you don't want to manually cd to the Discourse root folder, then why not just add a fix to the rackup config.ru file:
# Insert as first line in config.ru
Dir.chdir(File.dirname(File.expand_path(__FILE__)))
Actually, it's not a problem with rackup; it's a problem with your code.
You have
require './lib/discourse_plugin_registry'
somewhere. This is not ideal. It should rather be something like:
require File.expand_path('../../lib/discourse_plugin_registry', __FILE__)
The way you have it, it uses the current directory explicitly, and no matter what you do to rackup, until you change the current directory - it won't work.
I've created an app but when I start the rails server I'm getting the following output. Anyone point me in the right direction as to what I'm doing wrong please? I'm pulling my hair out!
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': no such file to load -- openssl (LoadError)
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/session/cookie.rb:1
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/actionpack-3.1.3/lib/action_dispatch/middleware/session/cookie_store.rb:4
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application/configuration.rb:131:in `const_get'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application/configuration.rb:131:in `session_store'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:172:in `default_middleware_stack'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:146:in `tap'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:146:in `default_middleware_stack'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/engine.rb:446:in `build_middleware_stack'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application/finisher.rb:37
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `run_initializers'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `send'
from /usr/local/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/khussain/delete/config/environment.rb:5
from /home/khussain/delete/config.ru:4:in `require'
from /home/khussain/delete/config.ru:4
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/builder.rb:51:in `initialize'
from /home/khussain/delete/config.ru:1:in `new'
from /home/khussain/delete/config.ru:1
If the above doesn't work, then it's probably because you don't have a .Gemfile ?
This looks like a gem is missing (openssl), without seeing the code I'm not sure.
The best thing would be to run:
bundle install
If this still doesn't work try adding openssl to your Gemfile and running bundle install again
I am simply requiring a file present in the same folder as the testfile however I am getting this wierd message again and again...
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- a.rb (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/dummyFirefox/test_a.rb:1:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `block in load_spec_files'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `map'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load_spec_files'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:18:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `block in autorun'
the code that I write in my testfile test_a.rb is simply:
require 'a.rb'
and when I issue the command : rspec test_a.rb the message is the above mentioned error.
I am using ruby-1.9.2 for development.
Hope I don't miss any details.
Thanks in advance.
In Ruby 1.9.2 the current working directory is no longer part of the load path ($LOAD_PATH or $:). You have to add it manually using:
$LOAD_PATH.unshift '.'
or
$:.unshift '.'
Or you can require the file explicitly:
require './test_a.rb'