有个 rails 工程(redmine2.3),rails3.2 的 启动就报错
启动命令
bundle exec thin start -p 8080 -e production -s 5 -d
错误信息
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
/var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `require': libruby.so.2.0: cannot open shared object file: No such file or directory - /var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/rubyeventmachine.so (LoadError)
from /var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/lib/thin.rb:7:in `require'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/lib/thin.rb:7:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/bin/thin:5:in `require'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/bin/thin:5:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/bin/thin:23:in `load'
from /var/wtn/vendor/cache/ruby/2.0.0/bin/thin:23:in `<main>'
###重点
看上去似乎是有另一个 rails?
然后输入
rails -v
居然也报同样的信息
rails -v
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
在工程目录下 bundle exec ... 也是报上面的错误。
其他信息:
$ bundle env
Bundler 1.3.5
Ruby 2.0.0 (2013-06-27 patchlevel 247) [x86_64-linux]
Rubygems 2.0.6
GEM_HOME
Bundler settings
without
Set for your local app (/var/wtn/.bundle/config): "test:rmagick"
path
Set for your local app (/var/wtn/.bundle/config): "vendor/cache"
disable_shared_gems
Set for your local app (/var/wtn/.bundle/config): "1"
Gemfile
source 'http://ruby.taobao.org'
gem "rails", "3.2.13"
gem "jquery-rails", "~> 2.0.2"
gem "i18n", "~> 0.6.0"
gem "coderay", "~> 1.0.6"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder", "3.0.0"
gem "httparty"
gem "thin"
# markdown
# download plugin from https://github.com/alminium/redmine_redcarpet_formatter
# git clone git://github.com/alminium/redmine_redcarpet_formatter.git
# then select 'markdown' in admin settings => text format
gem "redcarpet"
# Optional gem for LDAP authentication
group :ldap do
gem "net-ldap", "~> 0.3.1"
end
# Optional gem for OpenID authentication
group :openid do
gem "ruby-openid", "~> 2.1.4", :require => "openid"
gem "rack-openid"
end
# Optional gem for exporting the gantt to a PNG file, not supported with jruby
#platforms :mri, :mingw do
# group :rmagick do
# RMagick 2 supports ruby 1.9
# RMagick 1 would be fine for ruby 1.8 but Bundler does not support
# different requirements for the same gem on different platforms
# gem "rmagick", ">= 2.0.0"
# end
#end
platforms :jruby do
# jruby-openssl is bundled with JRuby 1.7.0
gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
gem "activerecord-jdbc-adapter", "1.2.5"
end
# Include database gems for the adapters found in the database
# configuration file
require 'erb'
require 'yaml'
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
database_config = YAML::load(ERB.new(IO.read(database_file)).result)
adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
if adapters.any?
adapters.each do |adapter|
case adapter
when 'mysql2'
gem "mysql2", "~> 0.3.11", :platforms => [:mri, :mingw]
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
when 'mysql'
gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw]
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
when /postgresql/
gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
when /sqlite3/
gem "sqlite3", :platforms => [:mri, :mingw]
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
when /sqlserver/
gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw]
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
else
warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
end
end
else
warn("No adapter found in config/database.yml, please configure it first")
end
else
warn("Please configure your config/database.yml first")
end
group :development do
gem "rdoc", ">= 2.4.2"
gem "yard"
end
group :test do
gem "shoulda", "~> 3.3.2"
gem "mocha", "~> 0.13.3"
gem 'capybara', '~> 2.0.0'
end
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
if File.exists?(local_gemfile)
puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
instance_eval File.read(local_gemfile)
end
# Load plugins' Gemfiles
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
instance_eval File.read(file)
end
Gemfile.lock
GEM
remote: http://ruby.taobao.org/
remote: https://rubygems.org/
remote: https://rubygems.org/
specs:
ZenTest (4.5.0)
actionmailer (3.2.13)
actionpack (= 3.2.13)
mail (~> 2.5.3)
actionpack (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
activerecord (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (~> 1.0)
arel (3.0.3)
autotest-rails (4.2.1)
ZenTest (~> 4.5)
builder (3.0.0)
capybara (2.0.3)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 1.0.0)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
chronic (0.10.2)
coderay (1.0.9)
cucumber (1.3.16)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.1)
cucumber-rails (1.4.1)
capybara (>= 1.1.2, < 3)
cucumber (>= 1.3.8, < 2)
mime-types (~> 1.16)
nokogiri (~> 1.5)
rails (>= 3, < 5)
culerity (0.2.15)
daemons (1.1.9)
database_cleaner (1.3.0)
diff-lcs (1.1.3)
docile (1.1.5)
erubis (2.7.0)
eventmachine (1.0.3)
fastercsv (1.5.5)
faye-websocket (0.4.7)
eventmachine (>= 0.12.0)
ffi (1.9.3)
gherkin (2.12.2)
multi_json (~> 1.3)
hike (1.2.3)
holidays (1.0.6)
http_parser.rb (0.5.3)
httparty (0.11.0)
json (~> 1.8)
multi_xml (>= 0.5.2)
i18n (0.6.1)
icalendar (2.1.1)
inifile (3.0.0)
journey (1.0.4)
jquery-rails (2.0.3)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.8.1)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.4)
mime-types (1.25.1)
mocha (0.13.3)
metaclass (~> 0.0.1)
multi_json (1.10.1)
multi_test (0.1.1)
multi_xml (0.5.5)
mysql2 (0.3.16)
net-ldap (0.3.1)
nokogiri (1.5.11)
open-uri-cached (0.0.5)
pdf-core (0.2.5)
poltergeist (1.1.2)
capybara (~> 2.0.1)
faye-websocket (~> 0.4.4)
http_parser.rb (~> 0.5.3)
polyglot (0.3.5)
prawn (1.2.1)
pdf-core (~> 0.2.5)
ttfunk (~> 1.2.0)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-openid (1.4.2)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.13)
actionmailer (= 3.2.13)
actionpack (= 3.2.13)
activerecord (= 3.2.13)
activeresource (= 3.2.13)
activesupport (= 3.2.13)
bundler (~> 1.0)
railties (= 3.2.13)
railties (3.2.13)
actionpack (= 3.2.13)
activesupport (= 3.2.13)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.3.2)
rdoc (3.12.2)
json (~> 1.4)
redcarpet (3.1.2)
rspec (2.11.0)
rspec-core (~> 2.11.0)
rspec-expectations (~> 2.11.0)
rspec-mocks (~> 2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.3)
diff-lcs (~> 1.1.3)
rspec-mocks (2.11.3)
rspec-rails (2.11.4)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.11.0)
ruby-openid (2.1.8)
ruby-prof (0.15.1)
rubyzip (1.1.6)
selenium-webdriver (2.42.0)
childprocess (>= 0.5.0)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0.4)
shoulda (3.3.2)
shoulda-context (~> 1.0.1)
shoulda-matchers (~> 1.4.1)
shoulda-context (1.0.2)
shoulda-matchers (1.4.1)
activesupport (>= 3.0.0)
simplecov (0.9.0)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
spork (0.9.2)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thin (1.6.2)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thor (0.19.1)
tilt (1.4.1)
timecop (0.3.5)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
ttfunk (1.2.0)
tzinfo (0.3.41)
websocket (1.0.7)
xpath (1.0.0)
nokogiri (~> 1.3)
yard (0.8.7.4)
PLATFORMS
ruby
DEPENDENCIES
ZenTest (= 4.5.0)
activerecord-jdbc-adapter (= 1.2.5)
activerecord-jdbcmysql-adapter
autotest-rails
builder (= 3.0.0)
capybara (~> 2.0.0)
chronic
coderay (~> 1.0.6)
cucumber-rails
culerity
database_cleaner
fastercsv (~> 1.5.0)
faye-websocket (~> 0.4.7)
gherkin (~> 2.6)
holidays (~> 1.0.3)
httparty
i18n (~> 0.6.0)
icalendar
inifile
jquery-rails (~> 2.0.2)
json
mocha (~> 0.13.3)
mysql2 (~> 0.3.11)
net-ldap (~> 0.3.1)
nokogiri (< 1.6.0)
open-uri-cached
poltergeist (~> 1.0)
prawn
rack-openid
rails (= 3.2.13)
rdoc (>= 2.4.2)
redcarpet
rspec (~> 2.11.0)
rspec-rails (~> 2.11.0)
ruby-openid (~> 2.1.4)
ruby-prof
shoulda (~> 3.3.2)
simplecov (~> 0.6)
spork
thin
timecop (~> 0.3.5)
yard