Trouble installing Rails App on MediaTemple? - ruby-on-rails

I am having some trouble installing an app on MediaTemple's Grid Servers... I'm deploying with cap and github... everything seems to go ok with those, but the app won't start up. There seems to be a problem with my database.yml file? I've checked for space errors and those all look good.
Here is a copy of the console when I try and start from there:
XXXXXXXXX.com#n11:/home/65633/containers/rails/GDB/current$ script/server RAILS_ENV="production" --trace
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
server: invalid option: --trace
=> Rails 2.2.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
config.gem: Unpacked gem geokit-1.4.1 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
Exiting
/home/65633/data/rubygems/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection': development database is not configured (ActiveRecord::AdapterNotSpecified)
from /home/65633/data/rubygems/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:53:in `establish_connection'
from /home/65633/data/rubygems/gems/gems/rails-2.2.2/lib/initializer.rb:392:in `initialize_database'
from /home/65633/data/rubygems/gems/gems/rails-2.2.2/lib/initializer.rb:139:in `process'
from /home/65633/data/rubygems/gems/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
from /home/65633/data/rubygems/gems/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
from /nfs/c04/h03/mnt/65633/containers/rails/GDB/releases/20090830045026/config/environment.rb:15
from /home/65633/data/rubygems/lib/rubygems/custom_require.rb:31:in `gem_original_require'
from /home/65633/data/rubygems/lib/rubygems/custom_require.rb:31:in `require'
... 24 levels...
from /home/65633/data/rubygems/gems/gems/rails-2.2.2/lib/commands/server.rb:49
from /home/65633/data/rubygems/lib/rubygems/custom_require.rb:31:in `gem_original_require'
from /home/65633/data/rubygems/lib/rubygems/custom_require.rb:31:in `require'
from script/server:3
Here is the mongrel log:
** Daemonized, any open files are closed. Look at log/mongrel.pid and log/mongrel.log for info.
** Starting Mongrel listening at 0.0.0.0:2017
** Starting Rails with production environment...
/home/65633/data/rubygems/lib/rubygems/custom_require.rb:31:in `gem_original_require': /home/65633/containers/rails/GDB/releases/20090830060044/app/controllers/administration_controller.rb:159: syntax error, unexpected kEND, expecting $end (SyntaxError)
from /home/65633/data/rubygems/lib/rubygems/custom_require.rb:31:in `require'
from /home/65633/data/rubygems/gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:155:in `require'
from /home/65633/data/rubygems/gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:262:in `require_or_load'
from /home/65633/data/rubygems/gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:221:in `depend_on'
from /home/65633/data/rubygems/gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:133:in `require_dependency'
from /home/65633/data/rubygems/gems/gems/rails-2.2.2/lib/initializer.rb:368:in `load_application_classes'
from /home/65633/data/rubygems/gems/gems/rails-2.2.2/lib/initializer.rb:367:in `each'
from /home/65633/data/rubygems/gems/gems/rails-2.2.2/lib/initializer.rb:367:in `load_application_classes'
... 17 levels...
from /home/65633/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/bin/../lib/mongrel/command.rb:212:in `run'
from /home/65633/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/bin/mongrel_rails:281
from /home/65633/data/rubygems/gems/bin/mongrel_rails:19:in `load'
from /home/65633/data/rubygems/gems/bin/mongrel_rails:19
mtr start error
application started, but pid file was not found, check 'mtr status'

The command script/server RAILS_ENV="production" clearly doesn't start Mongrel with the development environment, as you can see from this log line from your first excerpt:
** Starting Rails with development environment...
Furthermore, if you try to run RAILS_ENV=production script/server, does the application start without any gem related errors? That's what I would check.
As for the error in the second logfile, I'm not really sure. What is in line 159 of your administration_controller.rb?

Related

ruby 3.0.4, redmine 5.0.0, rails 6.1.4, test install start with webrick fails, "wrong number of arguments"

New ubuntu-20 system with the following:
ruby 3.0.4
rails 6.1.4
redmine 5.0.0
After install, trying to start webrick test server:
bundle exec rails server webrick -e redmine_test
fails with:
/home/test_user/.gem/ruby/3.0.4/gems/thor-1.2.1/lib/thor/base.rb:525:in `handle_argument_error':
ERROR: "rails server" was called with arguments ["webrick"] (Thor::InvocationError)
Usage: "rails server -u [thin/puma/webrick] [options]"
from .../thor-1.2.1/lib/thor/command.rb:34:in `rescue in run'
from .../thor-1.2.1/lib/thor/command.rb:20:in `run'
from .../thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from .../thor-1.2.1/lib/thor.rb:392:in `dispatch'
from .../railties-6.1.4.7/lib/rails/command/base.rb:69:in `perform'
from .../railties-6.1.4.7/lib/rails/command.rb:48:in `invoke'
from .../railties-6.1.4.7/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
.../railties-6.1.4.7/lib/rails/commands/server/server_command.rb:130:in `perform':
wrong number of arguments (given 1, expected 0) (ArgumentError)
from .../thor-1.2.1/lib/thor/command.rb:27:in `run'
from .../thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from .../thor-1.2.1/lib/thor.rb:392:in `dispatch'
from .../railties-6.1.4.7/lib/rails/command/base.rb:69:in `perform'
from .../railties-6.1.4.7/lib/rails/command.rb:48:in `invoke'
from .../railties-6.1.4.7/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
It's not clear to me which arguments / syntax it's complaining about; I've tried different combinations and all complain about wrong number of arguments:
bundle exec rails server webrick -e redmine_test (given 1, expected 0)
bundle exec rails server webrick -e=redmine_test (given 1, expected 0)
RAILS_ENV=redmine_test bundle exec rails server webrick (given 1, expected 0)
bundle exec rails server webrick redmine_test (given 2, expected 0)
bundle exec rails server webrick (given 1, expected 0)
The command-line format seems to have changed for Rails 6:
> rails server --help
Usage:
rails server -u [thin/puma/webrick] [options]
^^
You may also need to add webrick to your Gemfile:
bundle add webrick
Casper showed that solution and I am rearranging the solution point by point here.
Add webrick if it's not already installed. bundle add webrick
Run bundle exec rails server -u webrick -e redmine_test
Look at the last keyword redmine_test. It's the enviroment that you are using for this case. So, write production if you are trying to run it in production.

Execute tests in RubyMine causes "uninitialized constant Spring::Client::Run::UNIXSocket" on Windows 7

In RubyMine, I try to run tests in debug (equivalent to rails test, but with debug mode in RubyMine). I get this log in RubyMine console:
Testing started at 08:44 ...
C:\Ruby23-x64\bin\ruby.exe C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.7.0.beta4/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 55232 --host 0.0.0.0 --dispatcher-port 55233 -- C:/Users/[ANONYMOUS]/bin/rails test
Fast Debugger (ruby-debug-ide 0.7.0.beta4, debase 0.2.2, file filtering is supported) listens on 0.0.0.0:55232
Uncaught exception: uninitialized constant Spring::Client::Run::UNIXSocket
Did you mean? Socket
IPSocket
UDPSocket
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/run.rb:26:in `connect'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/run.rb:31:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:24:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
C:/Users/[ANONYMOUS]/bin/spring:15:in `<top (required)>'
C:/Users/[ANONYMOUS]/bin/rails:3:in `load'
C:/Users/[ANONYMOUS]/bin/rails:3:in `<top (required)>'
Process finished with exit code 0
It seems like RubyMine tries to run against some UNIX configuration, but I couldn't find anything related to this in my files.
I run RubyMine with Ruby 2.3.3, on Windows 7, RubyMine 2018.1.4.
When I run tests without the debug mode, everything is fine.
How could I resolve this problem? Thanks.
You need to uninstall spring as it's not supported on Windows.
From thier README:
Spring makes extensive use of Process.fork, so won't be able to provide a speed up on platforms which don't support forking (Windows, JRuby).
To uninstall:
'Unspring' your bin/ executables:
spring binstub --remove --all
Remove spring from your Gemfile
Recreate your gemlock file by running:
bundle install

Rails rake db:create does not work

I come from a computer science and programming background, and I am familiar with a *nix CLI.
I am new to ruby on rails, and I am doing an online bootcamp. One of my lessons has me creating a new rails application. It starts out with the following commands to create a new rails application and create the database:
$ rails new bloccit -T
$ cd bloccit
$ rake db:create
When I run the rake command, the process just hangs. I let it run for 30 minutes, and it just sat there. When I do a hard interrupt, I get the following stack trace:
^C/Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/client/run.rb:99:in `gets': Interrupt
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/client/run.rb:99:in `verify_server_version'
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/client/run.rb:56:in `run'
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/client/run.rb:37:in `warm_run'
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/client/run.rb:26:in `call'
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/client/command.rb:7:in `call'
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/client.rb:26:in `run'
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/bin/spring:48:in `<top (required)>'
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/binstub.rb:11:in `load'
from /Users/mikekeathley/.rvm/gems/ruby-2.2.1/gems/spring-1.3.4/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/mikekeathley/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/mikekeathley/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/mikekeathley/code/bloccit/bin/spring:13:in `<top (required)>'
from bin/rake:3:in `load'
from bin/rake:3:in `<main>'
I understand the stack trace: on line 99 in the run.rb file, the method gets is getting stuck. I just don't know anything about spring.
I am running Ruby 2.2.1p85, Rails 4.2.1, and sqlite3 1.3.10.
Stop spring by using command
bin/spring stop
and then run rake command again. It would fix this issue.

Ruby 1.8.6 app cannot start (cannot remove Object::Helpers (NameError))

after a Windows Update automatic server restart our Ruby dev app won't start anymore. No new changes in the repository. I have no clue where to go from here. Anyone?
C:\webapp>ruby script/server -p3002
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3002
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3002
** Starting Rails with development environment...
GLoc v1.2 running in development mode. Strings can be modified at runtime.
Exiting
./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:422:in `remove_const': cannot remove Object::Helpers (NameError)
from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:422:in `send'
from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:422:in `remove_constant'
from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in `new_constants_in'
from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in `each'
from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in `new_constants_in'
from ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require'
from C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:147:in `rails'
from C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:113:in `cloaker_'
... 19 levels...
from ./script/../config/../vendor/rails/railties/lib/commands/server.rb:39
from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3
C:\webapp>
Something happened to the ODBC data source somehow. Our ODBC data source had been 64-bit for weeks, but for the app to work again, I had to create a 32-bit data source using C:\Windows\SysWOW64\odbcad32.exe.

LibraryFind Installation

i am trying to install LibraryFind and i was successfull in many aspects until i reached the step where i have to run my application.
i enter the following command and i get these results.
r
oot#ubuntu:/home/administrator/Desktop/trunk# ruby script/server
=> Booting WEBrick...
=> Rails 2.2.2 application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2011-08-24 02:01:55] INFO WEBrick 1.3.1
[2011-08-24 02:01:55] INFO ruby 1.8.7 (2010-08-16) [i686-linux]
[2011-08-24 02:01:55] WARN TCPServer Error: Address already in use - bind(2)
/usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `new'
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners'
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `each'
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners'
from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
from /home/administrator/Desktop/trunk/vendor/rails/railties/lib/webrick_server.rb:56:in `new'
from /home/administrator/Desktop/trunk/vendor/rails/railties/lib/webrick_server.rb:56:in `dispatch'
from /home/administrator/Desktop/trunk/vendor/rails/railties/lib/commands/servers/webrick.rb:66
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
from /home/administrator/Desktop/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
from /home/administrator/Desktop/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /home/administrator/Desktop/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
from /home/administrator/Desktop/trunk/vendor/rails/railties/lib/commands/server.rb:49
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
from script/server:3
it seems im either missing a library or i am having a problem in my configurat
There is another instance of webrick running of the port 3000. Use the command
ps aux | grep webrick
To verify it. And then kill it.
EDIT:
The ps command shows you a list of the current running programs of your machine. Each program on a unix-like machine comes with a PID number associated with it. In your case, the other running instance has a pid = 12288. So you can use:
kill 12288
To kill the other instance of the server.

Resources