colleagues.
Here is what I have:
Windows XP
Ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
Rails 3.1.0
Also I have installed mongrel server gem install mongrel -v 1.2.0.pre2 --pre
When I do rails s, mongrel starts (everything is ok)
But I want to use my RoR application via Apache 2.2, that is installed as service.
I decided that best way is to use Apache & Mongrel. Then I have installed mongrel_service gem install mongrel_service, and run mongrel as service mongrel_rails service::install -N efiling_mongrel -c c:\sites\uplodify -p 3000 -e development -a 127.0.0.1. Then I also setuped Apache...
When I started Apache as service and Mongrel as service, I see such picture:
1) my ruby proccess uses more than 50% of CPU resource
2) permanent growth log/mongrel.log file size
3) there are such errors in log/mongrel.log:
** Starting Mongrel listening at 127.0.0.1:3000
** Starting Rails with development environment...
C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:240:in `require': no such file to load -- dispatcher (LoadError)
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.1.0/lib/active_support/dependencies.rb:240:in `require'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/rails.rb:148:in `rails'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:116:in `block (2 levels) in run'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/configurator.rb:149:in `call'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/configurator.rb:149:in `listener'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:102:in `block in run'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/configurator.rb:50:in `call'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/configurator.rb:50:in `initialize'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:86:in `new'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:86:in `run'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/lib/mongrel/command.rb:210:in `run'
from C:/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-ingw32/bin/mongrel_rails:282:in `<top (required)>'
from C:/Ruby/Ruby192/bin/mongrel_rails:19:in `load'
from C:/Ruby/Ruby192/bin/mongrel_rails:19:in `<main>'
Someone have any ideas?
Related
im trying to get started with rails. I have made a rails project and now im trying to start the server but get this.
C:\Users\Home\Documents\Sites\simple_cms>rails server
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.2/mysql2 (LoadError)
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler.rb:134:in `require'
from C:/Users/Home/Documents/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
my gemfile has gem 'mysql2', '~> 0.3.18'
windows 7
ruby version 2.2.1
rails 4.2.1
mySql server version 5.6.24
Edit:
Couldn't find a solution that worked for me so i installed a different version of rails and it worked out.
Make sure you have installed mysql2 gem using bundle install and that bundle install has returned successful installation.
#James, This issue has been already raised so follow these links and hope this may help you.
1) Error "...cannot load such file -- mysql2/2.0/mysql2 (LoadError)". On Windows XP with Ruby 2.0.0
2) Ruby on Rails - cannot load such file -- mysql2/2.2/mysql2 (LoadError)
3) https://github.com/bundler/bundler/issues/3456
Try to change
gem 'mysql2', '~> 0.3.18'
to
gem 'mysql2', '~> 0.3.11'
I think that maximum compatible version with Windows is 0.3.11. Then run again bundle install
Attempting to build a site with Jekyll using the jekyll-assets gem, I noticed that my changes were not being auto regenerated despite using the --watch flag on my jekyll serve command. Was a big headache having to stop the server every time I wanted to see changes in the browser so I tried to troubleshoot the problem and after a while learned that auto regeneration will not occur with the jekyll serve --watch command in Vagrant, which I'm using.
To avoid this headache I attempted to install necessary dependencies outside of Vagrant and jekyll serve --watch but am getting the following:
Configuration file: /Users/jamestargett/Code/jekyll_fingers/_config.yml
/Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- jekyll-assets (LoadError)
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/jamestargett/Code/jekyll_fingers/_plugins/ext.rb:1:in `<top (required)>'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:77:in `block (2 levels) in setup'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:76:in `each'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:76:in `block in setup'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:75:in `each'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:75:in `setup'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:29:in `initialize'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/commands/build.rb:5:in `new'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/commands/build.rb:5:in `process'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/bin/jekyll:97:in `block (2 levels) in <top (required)>'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:402:in `run_active_command'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:66:in `run!'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/delegates.rb:7:in `run!'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>'
I've tried googling the problem but am pretty new to web development and a little lost.
I've also faced this problem. Looks like its a bug in the newest Jekyll 1.4.2 build. A fix can be uninstalling Jekyll 1.4.2 and installing a stable release, in my knowledge which is 1.2.1
Uninstall Jekyll and reinstall Jekyll 1.2.1 by following these commands
~ $ gem uninstall jekyll
~ $ gem install jekyll --version(="1.2.1")
Running gem install jekyll -v 1.2.1 would also work
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
I added gem 'redis' to my Gemfile. Ran bundle install. Restarted the local server, then ran the hello world example in my console only to get an error. Any idea what's wrong?
[kudo (develop)]$ rails console
Loading development environment (Rails 3.2.3)
1.9.3p125 :001 > redis = Redis.new
=> #<Redis client v3.0.2 for redis://127.0.0.1:6379/0>
1.9.3p125 :002 > redis.set("mykey", "hello world")
Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED)
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:268:in `rescue in establish_connection'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:263:in `establish_connection'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:69:in `connect'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:282:in `ensure_connected'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:173:in `block in process'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:248:in `logging'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:172:in `process'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis/client.rb:84:in `call'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis.rb:608:in `block in set'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis.rb:36:in `block in synchronize'
from /Users/pejman/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis.rb:36:in `synchronize'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/redis-3.0.2/lib/redis.rb:607:in `set'
from (irb):2
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands/console.rb:47:in `start'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands/console.rb:8:in `start'
from /Users/pejman/.rvm/gems/ruby-1.9.3-p125#rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'1.9.3p125 :003 >
Ended up being pretty simple.
To install redis (server) I ran (in the terminal):
brew install redis
Then in a separate terminal window, I started the server with:
redis-server
Now I'm all setup. My redis.set command works fine now in the rails console.
Here's a good resource I found that walks through it more in depth: http://jimneath.org/2011/03/24/using-redis-with-ruby-on-rails.html
I'm trying to install passenger-install-apache2-module but get this error:
[root#devserver redmine]# passenger-install-apache2-module
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'rails (= 3.2.6) ruby' in the gems available on this machine. (Bundler::GemNotFound)
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:161:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:128:in `block in resolve'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `catch'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `resolve'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/definition.rb:192:in `resolve'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in `specs'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/environment.rb:27:in `specs'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:9:in `<main>'
What I miss?
looks like passenger is in your Gemfile, you can fix it in few ways:
run bundle install
run NOEXEC=0 passenger-install-apache2-module
It seems not to be possible to run passenger-install-apache2-module in the Rails project folder. Go one folder up and try again. -Íris