반응형
250x250
Notice
Recent Posts
Recent Comments
Link
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Archives
Today
Total
관리 메뉴

가끔 보자, 하늘.

ruby on rails 윈도우 설치 본문

개발 이야기/개발 및 서비스

ruby on rails 윈도우 설치

가온아 2014. 4. 20. 12:35



1. ruby 설치

   http://rubyinstaller.org/downloads/ 에서 ruby 설치


2. rubygems 설치. 이것은 ruby를 위한 패키지 관리 프레임웍이다. 이를 설치하는 과정은 아래.

   gem update --system  입력하여 rubygem 설치

   gem install rubygems-update 입력

   update_rubygems 입력


3. rails 설치

   gem install rails 

  -> 설치 중 아래 에러 발생

Installing ri documentation for actionpack-4.1.0

ERROR:  While executing gem ... (Errno::EINVAL)

    Invalid argument - ./ActionDispatch/Routing/Mapper/Scoping/:

  -> gem install rdoc 한 후 재설치를 시작했지만 반응 없음. 중단!!

  -> gem uninstall rails 실행하여 삭제. 

  -> gem install rails 재입력. 에러 없음. 단, 이전에 에러가 난 actionpack-4.1.0을 재설치한 것이 아니라 이상함.

  -> gem install actionpack 재설치 시도. 정상적임.


3-1. rails new hello로 테스트 시도. 아래 에러 발생.

 Gem::InstallError: The 'json' native gem requires installed build tools.


4. devkit 설치

   https://github.com/oneclick/rubyinstaller/wiki/Development-Kit 에서 다운로드

   ruby가 설치된 폴더의 devkit폴더를 만들어 압축 품.

     * 이 사이트에서 폴더명에 공백이 있으면 안된다고 함. 전체 폴더 포함해서.

  devkit의 bin에 가서

  ruby dk.rb init/review/install 를 순서대로 처리. 모두 정상.

 

4-1. rails new hello로 다시 테스트 시도. 성공


4-2. rails server 테스트.  에러 발생

C:/Ruby200/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/data_source.rb:199:i

n `rescue in create_default_data_source': No timezone data source could be found

. To resolve this, either install TZInfo::Data (e.g. by running `gem install tzi

nfo-data`) or specify a zoneinfo directory using `TZInfo::DataSource.set(:zonein

fo, zoneinfo_path)`. (TZInfo::DataSourceNotFound)

  .

  .

[출처] ruby on rails 설치|작성자 바다와해

  이상한 건 설치된 tzinfo의 version이 2.2.2인 상태. 에러의 내용과 조금 다른게 아닌가 생각됨. gems 폴더에 가도 tzinfo-1.1.0 만 존재함.


4-3. bundle install 하라는 메세지가 떠서 일단 이거 실행. 에러에 대한 변화는 없음.


4-4. 아래 사이트에서 64bit 버전에서의 Gemfile에 빠져 있는 x64_mingw 옵션을 넣으면 된다는 아티클이 있지만, 역시 같은 결과임.

  http://stackoverflow.com/questions/23022258/tzinfodatasourcenotfound-error-starting-rails-v4-1-0-server-on-windows


gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

Background

The TZInfo::DataSourceNotFound error is being raised by TZInfo, a dependency of the Active Support component of Rails. TZInfo is looking for a source of time zone data on your system, but failing to find one.

On many Unix-based systems (e.g. Linux), TZInfo is able to use the system zoneinfo directory as a source of data. However, Windows doesn't include such a directory, so the tzinfo-data gem needs to be installed instead. The tzinfo-data gem contains the same zoneinfo data, packaged as a set of Ruby modules.

Rails generates a default Gemfile when the application is first created. If the application is created on Windows, then a dependency for tzinfo-data will be included. However (as of Rails version 4.1.0), this omits :x64_mingw from the list of platforms, so doesn't work correctly on 64-bit Windows versions of Ruby. This should be fixed in future Rails releases.


4-5. devkit 32bit 버전을 재설치. 에러는 같은 상태.


4-6. 프로젝트 파일에 Gemfile 하단부에 64비트 버전 정보와 bundler 정보 추가

gem 'bundler'

gem 'tzinfo-data', platforms: [:mingw, :mswin , :x64_mingw]


4-7. rails server 성공!!



반응형