SQL Server를 Rails 응용 프로그램 (Windows 7)에 연결하는 방법을 보여주는 좋은 자료를 가르쳐 주시겠습니까?rails server 명령에 오류가 있습니다.
나는 지금까지 다음과 같은 짓을 : 마지막 명령 후 rails new simple_cms –d sqlserver
gem install bundle
rails s
을,이 오류가 발생합니다 :
C:\Sites\s_cms>rails s
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-4.1.1/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method': undefined method `add_order!' for class `Class' (Name
Error)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-4.1.1/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method_chain'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter/core_ext/active_record.rb:14:in `singletonclass'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter/core_ext/active_record.rb:12:in `inc
luded'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter/core_ext/active_record.rb:145:in `in
clude'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter/core_ext/active_record.rb:145:in `<t
op (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter.rb:3:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter.rb:3:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-2.3.8/lib/activerecord-sqlserver-adapter.rb:1:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-2.3.8/lib/activerecord-sqlserver-adapter.rb:1:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.1/lib/bundler.rb:132:in `require'
from C:/Sites/s_cms/config/application.rb:7:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:79:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `tap'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `server'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
PS를 : 내가 사용하는 경우 sqlite를 데이터베이스 시스템으로 사용하면 웹 서버를 성공적으로 시작할 수 있습니다 (오류 없음). 이것은 아마도 레일 설치에 아무런 문제가 없다는 것을 의미합니다. 나는 sth를 database.yml에 추가하거나 어딘가에 데이터베이스 사용자와 암호를 작성해야 할 필요가 있다고 생각한다. 하지만 어떻게 이것이 sqlite3에서 필요하지 않은가? 이 리소스를 찾았지만 아직 적용 가능한지 확실하지 않습니다 (레일 2.0을 말합니다. 레일 4.1.1을 사용하는 반면) http://rubyrailsandwindows.blogspot.de/2008/03/rails-2-and-sql-server-2008-on-windows_24.html - 거기에서 몇 가지 시도했지만 적용되지 않았습니다. 미리 감사드립니다.
나중에 편집 : 나는 또한 포함합니다 (config 폴더에서)를 database.yml을 편집 한 후 rails s
을 시도 :
development:
adapter: sqlserver
encoding: unicode
database: cms
pool: 5
username: guest1
password: pwd1234%^&^
test:
adapter: sqlserver
encoding: unicode
database: cms
pool: 5
username: guest1
password: pwd1234%^&^
production:
adapter: sqlserver
encoding: unicode
database: cms
pool: 5
username: guest1
password: pwd1234%^&^
(물론, 나는 이전에 생성 된 DB는 CMS를 호출하고, 사용자를 추가
: 지정된 암호를 사용하여 참석자 1이라고, 다음 TEH 자격 증명이 나는 위와 같이 유사한 오류가이 새로운 조치 후 내 로컬 SQL 서버 자체)에서 모방-ING 네트워크 연결로 DB에 연결하는 일을 확인했다
C:\Sites\simple_cms>rails s
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-.1.1/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method': undefined method `add_order!' for class `Class' (Name Error)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-4.1.1/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method_chain'
...............
정말 고마워요, 그레이엄. 내가 추천 한대로 gemfile을 편집 한 다음,'rails s'를 다시 한번 실행했다. 그것은'bundle install '을 할 수있게 해주었습니다. 그러나 실행을 시도한 후에 다음과 같은 메시지가 나타납니다 :'Fetching https://github.com/Desarrollo-CeSPI/activerecord-sqlserver-adapter.git fatal : 액세스 할 수 없습니다. 'https://github.com/Desarrollo-CeSPI/activerecord-sqlserver-adapt er.git /': github.com:443에 연결하지 못했습니다. 오류 없음 git clone 재시도 "https://github.com/Desarrollo-CeSPI/activerecord-sqlserver-adapter.gi t" ""C : /Ruby193/lib/ruby/gems/1.9.1/cache/bundler/git/프록시를 사용하여 activerecord-sqlserver-adapter-a19f0 dc7902 .....' – Samy
프록시 때문에 다시있을 수 있습니까? 여기 제안 된대로 HTTP_PROXY 환경 변수를 설정 한 후 제거했다고 생각했습니다. http : // stackoverflow. co.kr/questions/23607571/set-proxy-for-rubygems. 번들이 프록시 (구문 ??)로 실행되도록 강제하는 방법이나 그것이 문제가되는지 모르겠습니다. 이상하게도, 브라우저에이 주소를 입력하여 https://github.com/Desarrollo-CeSPI/activerecord-sqlserver-adapter.git로 이동하면 다시 프록시라고 생각할 수 있습니다. – Samy
프록시가 될 수 있습니다. 유효한 .gemspec가 있어야 작동 할 수 있습니다.저장소에 액세스 할 수 있다면 zip으로 가져와야 할 수도 있습니다 (복제 할 수있는 경우가 아니라면). '<방금 만들어진 보석의 이름> 설치 어딘가에 다음 보석'다음에 그 디렉토리에'보석 빌드 액티브 - SQLSERVER-adapter.gemspec'을 실행 –