我似乎无法通过运行按钮运行我的服务器,但预览工作和命令有效。
我为达到这一点所做的步骤:
启动空白云9实例并运行以下命令:
$ mkdir myapp
$ cd myapp
$ rvm use ruby-2.3.0@myapp --ruby-version --create
$ gem install rails
$ rails new .
$ rake -T
$ rails server -p $PORT -b $IP
此时预览有效,我可以访问https://[workspace]-[user].c9users.io。但是,如果我按下运行然后单击CWD并选择myapp文件夹我收到以下错误:
myapp/Gemfile: No such file or directory
运行面板中显示的命令是myapp/Gemfile
我在更改cwd之前将CWD更改为myapp文件夹和myapp / Gemfile时也尝试使用Gemfiel
。
运行按钮只是运行命令rails server -p $PORT -b $IP
的一种方式,如果是这样,那么只要该命令有效并且我可以访问该站点,那么除了保存输入之外没有其他方法可以按运行吗?
答案 0 :(得分:1)
The first you need to consider, is that your app is running without problems (run rails s -p $PORT -b $IP
without problems).
If that is the case, is really simple to set your Run to run your app.
First in your menu go to Run > Run Configuration > Run new configuration
Then It will open a run configuration tab, where you need to set your "Currente Working Directory" by clicking on CWD
And finally, you need to type your command (in the command textbox) to start your rails app, something like:
rails s -p $PORT -b $IP
With that you will get your app running with the Run button.
Source: docs.c9