Question

I'm trying to run a Ruby/Rails tutorial on Debian 7.3 (Ruby 1.9.3p194, Rails 2.3.14) and I can't seem to get the server to start with any command-line arguments. As root, I created a rails skeleton directory in /root with

# rails -d postgresql demo/inventory

I can start the server on the default port 3000 by executing script/server, but giving any combination of command-line arguments (e.g. -d for daemon mode, -p 80 to run on port 80) gives an error:

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- rack/handler/-p (LoadError)

or

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- rack/handler/-d (LoadError)

Any command-line argument is treated likewise. The final fatal error is preceded by a stack of warnings (even if I successfully start the server on port 3000 with no arguments):

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /root/demo/inventory/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /root/demo/inventory/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.

The last warning is repeated several times. I get the feeling I'm missing some package or gem, but I don't know where to start.

Was it helpful?

Solution

firstly, and somewhat off topic, if you're starting a new rails project, you should probably use later versions of ruby and rails.

rails server -p 4567 is the command you're looking for when starting a server. i'm guessing you are passing the flag without indicating you want rails to start a server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top