无法从ascii-8bit转换为utf8

时间:2013-08-09 14:09:23

标签: ruby-on-rails

我正在铁轨上学习红宝石,所以我的问题可能非常基础。我在Windows 8上使用Ruby 2.0.0和rails 4.0。首先,我正在尝试在rails上安装ruby,但是我遇到了很多错误:

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

分期付款成功,但我认为它错过了一些图片。我已经在网上搜索了,很多人说对于MAC机器,它可以通过将.bash_profile添加到\ users \ username来修复,内容为:

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.

我错过了一些分期付款吗?请帮忙。

3 个答案:

答案 0 :(得分:0)

好吧,我终于解决了第二个问题并让Webrick跑了。事实证明,我必须首先创建应用程序,如“rails new myblog”,进入“cd myblog”目录,运行“bundle install”,之后我可以输入“rails s”来启动服务器。与apache服务器有点不同,apache服务器可以随时启动而无需创建任何应用程序。因此我的困惑。

如果有人能解决我的第一个问题,我将非常感激。

答案 1 :(得分:0)

您应该能够在Windows中设置与环境变量相同的变量。您可以从命令行使用setx(即setx LC_CTYPE“en_US.UTF-8”......参见here),这应该与上面的效果相同。

话虽这么说,我实际上并没有对Windows 8进行测试,因此您将不得不自己尝试一下......但这就是Windows 8相当于Mac上面的内容。

答案 2 :(得分:0)

在Windows 8上开发导轨是一件痛苦的事。它不是基于Linux的。你应该安装ubuntu

ascii-8bit to utf8错误。我遇到了类似的问题并用

修复了它

gem install rdoc

然后重新生成文档

gem rdoc --all --overwrite

这是一篇帮助我的帖子:Ruby on Rails - unable to convert "\x89" from ASCII-8BIT to UTF-8 for xxx/xxxx/xxxx

至于Windows 8开发尝试使用virtualbox作为ubuntu机器

http://nitrous.io/是一个很酷的项目,它允许您在已经设置的开发环境中在云中工作

相关问题