1

私はRuby on Railsを学んでいるので、私の質問は非常に基本的なものかもしれません. Windows 8 で Ruby 2.0.0 と Rails 4.0 を使用しています。まず、Ruby を Rails にインストールしようとしていますが、次のような多くのエラーが発生しました。

unable to convert from ascii-8bit to utf8 logo remix.gif, skipping

分割払いは成功しましたが、一部の画像が欠けていると思います。私は Web を検索しましたが、多くの人が MAC マシンについて次の内容で \users\username に .bash_profile を追加することで修正できると言っていました。

export LC_CTYPE=en_US.UTF-8
export LANG=en_US.UTF-8
unset LC_ALL

しかし、Windows 8マシンでこれを修正するにはどうすればよいですか?

次に、Windows 8 で Webrick サーバーを起動する方法を教えてください。参考までに、これが私の宝石のリストです。

actionmailer (4.0.0)
actionpack (4.0.0)
activemodel (4.0.0)
activerecord (4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.0)
arel (4.0.0)
atomic (1.1.12)
backports (3.3.3)
bigdecimal (1.2.1, 1.2.0)
builder (3.2.2, 3.1.4)
bundler (1.3.5)
coderay (1.0.9)
coffee-rails (4.0.0)
coffee-script (2.2.0)
coffee-script-source (1.6.3)
erubis (2.7.0)
execjs (1.4.0)
ffi (1.9.0)
formatador (0.2.4)
guard (1.8.2)
guard-sass (1.3.2)
hike (1.2.3)
i18n (0.6.4)
io-console (0.4.2)
jbuilder (1.5.0)
jquery-rails (3.0.4)
json (1.8.0, 1.7.7)
listen (1.2.2)
lumberjack (1.0.4)
mail (2.5.4)
method_source (0.8.2)
mime-types (1.23)
minitest (5.0.6, 4.7.5, 4.3.2)
multi_json (1.7.8)
polyglot (0.3.3)
pry (0.9.12.2)
psych (2.0.0)
rack (1.5.2)
rack-test (0.6.2)
rails (4.0.0)
railties (4.0.0)
rake (10.1.0, 0.9.6)
rb-fsevent (0.9.3)
rb-inotify (0.9.0)
rb-kqueue (0.2.0)
rdoc (4.0.1, 4.0.0, 3.12.2)
rubygems-update (2.0.6)
sass (3.2.10)
sass-rails (4.0.0)
sdoc (0.3.20)
slop (3.4.6)
specific_install (0.2.3)
sprockets (2.10.0)
sprockets-rails (2.0.0)
test-unit (2.5.5, 2.0.0.0)
thor (0.18.1)
thread_safe (0.1.2)
tilt (1.4.1)
treetop (1.4.14)
turbolinks (1.3.0)
tzinfo (1.0.1, 0.3.37)
uglifier (2.1.2)
webrick (1.3.1)
win32console (1.3.2)

「rails server」と入力すると、次のメッセージが表示されました。

   Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
                                 # Default: C:/Ruby200-x64/bin/ruby.exe
  -m, [--template=TEMPLATE]      # Path to some application template (can be a filesystem path or URL)
      [--skip-gemfile]           # Don't create a Gemfile
  -B, [--skip-bundle]            # Don't run bundle install
  -G, [--skip-git]               # Skip .gitignore file
      [--skip-keeps]             # Skip source control .keep files
  -O, [--skip-active-record]     # Skip Active Record files
  -S, [--skip-sprockets]         # Skip Sprockets files
  -d, [--database=DATABASE]      # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                 # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]  # Preconfigure for selected JavaScript library
                                 # Default: jquery
  -J, [--skip-javascript]        # Skip JavaScript files
      [--dev]                    # Setup the application with Gemfile pointing to your Rails checkout
      [--edge]                   # Setup the application with Gemfile pointing to Rails repository
  -T, [--skip-test-unit]         # Skip Test::Unit files
      [--rc=RC]                  # Path to file containing extra configuration options for rails command
      [--no-rc]                  # Skip loading of extra configuration options from .railsrc file

Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -q, [--quiet]    # Suppress status output
  -s, [--skip]     # Skip files that already exist

Rails options:
  -h, [--help]     # Show this help message and quit
  -v, [--version]  # Show Rails version number and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

    You can specify extra command-line arguments to be used every time
    'rails new' runs in the .railsrc configuration file in your home directory.

    Note that the arguments specified in the .railsrc file don't affect the
    defaults values shown above in this help message.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.

見逃した分割払いはありますか?助けてください。

4

3 に答える 3

0

Windows 8 でレールを開発するのは大変です。Linux ベースではありません。ubuntuをインストールする必要があります

ascii-8bit to utf8エラーについて。同様の問題があり、それを修正しました

gem install rdoc

次に、ドキュメントを再生成します

gem rdoc --all --overwrite

これは私を助けた投稿でした: Ruby on Rails - xxx/xxxx/xxxx の "\x89" を ASCII-8BIT から UTF-8 に変換できません

Windows 8の開発に関しては、ubuntuマシンにvirtualboxを使用してみてください

http://nitrous.io/は、開発環境がセットアップ済みのクラウドで作業できるクールなプロジェクトです。

于 2013-11-07T13:33:43.860 に答える
0

さて、ようやく 2 番目の問題を解決し、Webrick を実行することができました。結局のところ、最初に「rails new myblog」のようにアプリケーションを作成する必要があり、「cd myblog」ディレクトリ内に移動し、「bundle install」を実行します。その後、「rails s」と入力してサーバーを起動できます。アプリを作成せずにいつでも apache サーバーを起動できる apache サーバーの場合は少し異なります。したがって、私の混乱。

誰かが私の最初の問題を助けてくれれば、とても感謝しています。

于 2013-08-09T14:29:51.193 に答える
0

Windows の環境変数と同じ変数を設定できるはずです。コマンドラインから setx を使用できます (つまり、setx LC_CTYPE "en_US.UTF-8"...こちらを参照)。これにより、上記と同じ効果が得られます。

そうは言っても、実際にはこれをテストする Windows 8 を持っていないので、自分で試してみる必要があります... しかし、これは上記の Mac 用のものと同等の Windows 8 です。

于 2013-09-30T15:54:30.213 に答える