Rails S Won't Start the Server: Could not find

2019-05-26 23:04发布

问题:

I am fairly new to Ruby/Rails but I just have not found out how to get it started (it worked a few days ago).

I am in the actuall app folder and then

rails s
/Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError)
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
from /usr/bin/rails:18:in `<main>'

So when checking "gem list" the following is there

rails (3.1.0, 3.1.0.rc8, 3.1.0.rc6)
rails_config (0.2.4)

When I retry "gem install rails" I get

Successfully installed rails-3.1.0
1 gem installed
Installing ri documentation for rails-3.1.0...
file 'lib' not found
Installing RDoc documentation for rails-3.1.0...
file 'lib' not found

Bundle show rails:

WARNING:  #<ArgumentError: Illformed requirement ["#<YAML::Syck::DefaultKey:0x10dd4fec8> 2.10.3"]>
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
  s.name = %q{simplecov}
  s.version = "0.5.0"
(ETC:)

Gem Env:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.1.0]
  - INSTALLATION DIRECTORY: /Users/me/.rvm/gems/ruby-1.9.2-p290
  - RUBY EXECUTABLE: /Users/me/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/me/.rvm/gems/ruby-1.9.2-p290/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/me/.rvm/gems/ruby-1.9.2-p290
     - /Users/me/.rvm/gems/ruby-1.9.2-p290@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

I have tried for 8 hours straight now, maybe someone can help me out here? Thanks so much!

Edit 1:

Running bundle exec rails s:

WARNING:  #<ArgumentError: Illformed requirement ["#<YAML::Syck::DefaultKey:0x10dd4fec8> 2.10.3"]>
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
  s.name = %q{simplecov}
  s.version = "0.5.0"

  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
  s.authors = ["Christoph Olszowka"]
  s.date = %q{2011-09-09}
  s.description = %q{Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites}
  s.email = ["christoph at olszowka de"]
  s.files = [".gitignore", ".rvmrc", ".travis.yml", "Gemfile", "LICENSE", "README.rdoc", "Rakefile", "cucumber.yml", "features/config_adapters.feature", "features/config_autoload.feature", "features/config_command_name.feature", "features/config_coverage_dir.feature", "features/config_deactivate_merging.feature", "features/config_merge_timeout.feature", "features/config_project_name.feature", "features/config_styles.feature", "features/cucumber_basic.feature", "features/merging_test_unit_and_rspec.feature", "features/rspec_basic.feature", "features/rspec_groups_and_filters_basic.feature", "features/rspec_groups_and_filters_complex.feature", "features/rspec_without_simplecov.feature", "features/step_definitions/html_steps.rb", "features/step_definitions/simplecov_steps.rb", "features/step_definitions/transformers.rb", "features/step_definitions/web_steps.rb", "features/support/env.rb", "features/test_unit_basic.feature", "features/test_unit_groups_and_filters_basic.feature", "features/test_unit_groups_and_filters_complex.feature", "features/test_unit_without_simplecov.feature", "lib/simplecov.rb", "lib/simplecov/adapters.rb", "lib/simplecov/command_guesser.rb", "lib/simplecov/configuration.rb", "lib/simplecov/defaults.rb", "lib/simplecov/file_list.rb", "lib/simplecov/filter.rb", "lib/simplecov/formatter.rb", "lib/simplecov/formatter/simple_formatter.rb", "lib/simplecov/jruby_float_fix.rb", "lib/simplecov/merge_helpers.rb", "lib/simplecov/result.rb", "lib/simplecov/result_merger.rb", "lib/simplecov/source_file.rb", "lib/simplecov/version.rb", "simplecov.gemspec", "test/faked_project/Gemfile", "test/faked_project/Rakefile", "test/faked_project/cucumber.yml", "test/faked_project/features/step_definitions/my_steps.rb", "test/faked_project/features/support/env.rb", "test/faked_project/features/test_stuff.feature", "test/faked_project/lib/faked_project.rb", "test/faked_project/lib/faked_project/framework_specific.rb", "test/faked_project/lib/faked_project/meta_magic.rb", "test/faked_project/lib/faked_project/some_class.rb", "test/faked_project/spec/faked_spec.rb", "test/faked_project/spec/meta_magic_spec.rb", "test/faked_project/spec/some_class_spec.rb", "test/faked_project/spec/spec_helper.rb", "test/faked_project/test/faked_test.rb", "test/faked_project/test/meta_magic_test.rb", "test/faked_project/test/some_class_test.rb", "test/faked_project/test/test_helper.rb", "test/fixtures/app/controllers/sample_controller.rb", "test/fixtures/app/models/user.rb", "test/fixtures/deleted_source_sample.rb", "test/fixtures/frameworks/rspec_bad.rb", "test/fixtures/frameworks/rspec_good.rb", "test/fixtures/frameworks/testunit_bad.rb", "test/fixtures/frameworks/testunit_good.rb", "test/fixtures/resultset1.rb", "test/fixtures/resultset2.rb", "test/fixtures/sample.rb", "test/helper.rb", "test/shoulda_macros.rb", "test/test_1_8_fallbacks.rb", "test/test_command_guesser.rb", "test/test_deleted_source.rb", "test/test_file_list.rb", "test/test_filters.rb", "test/test_merge_helpers.rb", "test/test_result.rb", "test/test_return_codes.rb", "test/test_source_file.rb", "test/test_source_file_line.rb"]
  s.homepage = %q{http://github.com/colszowka/simplecov}
  s.require_paths = ["lib"]
  s.rubyforge_project = %q{simplecov}
  s.rubygems_version = %q{1.3.6}
  s.summary = %q{Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites}
  s.test_files = ["features/config_adapters.feature", "features/config_autoload.feature", "features/config_command_name.feature", "features/config_coverage_dir.feature", "features/config_deactivate_merging.feature", "features/config_merge_timeout.feature", "features/config_project_name.feature", "features/config_styles.feature", "features/cucumber_basic.feature", "features/merging_test_unit_and_rspec.feature", "features/rspec_basic.feature", "features/rspec_groups_and_filters_basic.feature", "features/rspec_groups_and_filters_complex.feature", "features/rspec_without_simplecov.feature", "features/step_definitions/html_steps.rb", "features/step_definitions/simplecov_steps.rb", "features/step_definitions/transformers.rb", "features/step_definitions/web_steps.rb", "features/support/env.rb", "features/test_unit_basic.feature", "features/test_unit_groups_and_filters_basic.feature", "features/test_unit_groups_and_filters_complex.feature", "features/test_unit_without_simplecov.feature", "test/faked_project/Gemfile", "test/faked_project/Rakefile", "test/faked_project/cucumber.yml", "test/faked_project/features/step_definitions/my_steps.rb", "test/faked_project/features/support/env.rb", "test/faked_project/features/test_stuff.feature", "test/faked_project/lib/faked_project.rb", "test/faked_project/lib/faked_project/framework_specific.rb", "test/faked_project/lib/faked_project/meta_magic.rb", "test/faked_project/lib/faked_project/some_class.rb", "test/faked_project/spec/faked_spec.rb", "test/faked_project/spec/meta_magic_spec.rb", "test/faked_project/spec/some_class_spec.rb", "test/faked_project/spec/spec_helper.rb", "test/faked_project/test/faked_test.rb", "test/faked_project/test/meta_magic_test.rb", "test/faked_project/test/some_class_test.rb", "test/faked_project/test/test_helper.rb", "test/fixtures/app/controllers/sample_controller.rb", "test/fixtures/app/models/user.rb", "test/fixtures/deleted_source_sample.rb", "test/fixtures/frameworks/rspec_bad.rb", "test/fixtures/frameworks/rspec_good.rb", "test/fixtures/frameworks/testunit_bad.rb", "test/fixtures/frameworks/testunit_good.rb", "test/fixtures/resultset1.rb", "test/fixtures/resultset2.rb", "test/fixtures/sample.rb", "test/helper.rb", "test/shoulda_macros.rb", "test/test_1_8_fallbacks.rb", "test/test_command_guesser.rb", "test/test_deleted_source.rb", "test/test_file_list.rb", "test/test_filters.rb", "test/test_merge_helpers.rb", "test/test_result.rb", "test/test_return_codes.rb", "test/test_source_file.rb", "test/test_source_file_line.rb"]

  if s.respond_to? :specification_version then
    current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
    s.specification_version = 3

    if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
      s.add_runtime_dependency(%q<simplecov-html>, ["~> 0.5.0"])
      s.add_development_dependency(%q<aruba>, [">= 0.4.5"])
      s.add_development_dependency(%q<capybara>, ["~> 1.0.0"])
      s.add_development_dependency(%q<cucumber>, ["~> 1.0.0"])
      s.add_development_dependency(%q<rake>, ["<= 0.9.0"])
      s.add_development_dependency(%q<rspec>, [">= 2.6.0"])
      s.add_development_dependency(%q<shoulda>, ["#<YAML::Syck::DefaultKey:0x10dd4fec8> 2.10.3"])
    else
      s.add_dependency(%q<simplecov-html>, ["~> 0.5.0"])
      s.add_dependency(%q<aruba>, [">= 0.4.5"])
      s.add_dependency(%q<capybara>, ["~> 1.0.0"])
      s.add_dependency(%q<cucumber>, ["~> 1.0.0"])
      s.add_dependency(%q<rake>, ["<= 0.9.0"])
      s.add_dependency(%q<rspec>, [">= 2.6.0"])
      s.add_dependency(%q<shoulda>, ["#<YAML::Syck::DefaultKey:0x10dd4fec8> 2.10.3"])
    end
  else
    s.add_dependency(%q<simplecov-html>, ["~> 0.5.0"])
    s.add_dependency(%q<aruba>, [">= 0.4.5"])
    s.add_dependency(%q<capybara>, ["~> 1.0.0"])
    s.add_dependency(%q<cucumber>, ["~> 1.0.0"])
    s.add_dependency(%q<rake>, ["<= 0.9.0"])
    s.add_dependency(%q<rspec>, [">= 2.6.0"])
    s.add_dependency(%q<shoulda>, ["#<YAML::Syck::DefaultKey:0x10dd4fec8> 2.10.3"])
  end
end
WARNING:  Invalid .gemspec format in '/Library/Ruby/Gems/1.8/specifications/simplecov-0.5.0.gemspec'
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3.
git://github.com/ryanb/nested_form.git (at master) is not checked out. Please run `bundle install`

Running gem pristine --all --no-extensions: running fine until rails:

Restored rack-mount-0.8.2
Restored rack-openid-1.3.1
Restored rack-ssl-1.3.2
Restored rack-test-0.6.1
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /Users/me/.rvm/gems/ruby-1.9.2-p290/gems/rails-3.1.0/bin/rails

回答1:

Did you try:

bundle install

And:

bundle exec rails s


回答2:

Can you try running the commands with rvmsudo?

For example, rvmsudo gem pristine....